forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Epoch > @datetime

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Jestem
Newbie


Joined: 15 Aug 2003
Posts: 7

PostPosted: Sat Jan 03, 2004 8:29 am    Post subject: Epoch > @datetime Reply with quote

I am not exactly sure if this is correct, so was hoping that someone could take a look at this math and see if I have it wrong, or perhaps there is a more efficient way of doing it. Converting epoch time to @dateformat() time-value:

Code:
REM Epoch for Jan 3, 03 - 02:19:17
%%epoch = 1073096357

REM Years since 1900 (windows) to 1970 (Unix)
%%fadd = 25569

%%vdsDate = @fadd(%%fadd,@fmul(@fdiv(@fdiv(@fdiv(@fdiv(%%epoch,365),24),60),60),365))

info Epoch date %%epoch is: @datetime(mmmm dd@chr(44) yyyy hh:nn:ss,%%vdsDate)


Last edited by Jestem on Mon Jan 05, 2004 6:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Jan 05, 2004 7:34 am    Post subject: Reply with quote

It certainly could be one way of doing this piece of math. I can see nothing wrong with it, except that
the variable %t in your %%vdsDate calc should be %%epoch, of course.

Greetz
Dr. Dread

BTW. This conversion to/fro UNIX date/time values is also in my TimeDate.dll
( http://www.vdsworld.com/?page=search&keywords=TimeDate.dll )

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group