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 


@datetime() float info...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Nov 18, 2002 12:26 pm    Post subject: @datetime() float info... Reply with quote

When using a @datetime() float, the TIME is to the right
of the decimal, and the DATE is to the left of the decimal.

1 whole number = 24hrs = 1440 mins = 86400 seconds

1 hour = .041666668
1 minute = .00069444447
1 second = .0000115740745

It's usually a good idea to use @name() to retrieve the
DATE portion, and @ext() to retrieve the TIME portion,
but you should also use: OPTION DECIMALSEP, "."
to allow for regions that use a comma as the decimal
separator (thanks to Dread for pointing this out).

Using @format() to retrieve DATE and TIME info may
not give correct results because it rounds numbers.
HOWEVER... using math functions with @datetime()
floats will cause an error if the result is too many digits,
so shortening the floats with @format() or @substr()
may be necessary to prevent this.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361


Last edited by Mac on Tue Nov 19, 2002 12:19 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


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

PostPosted: Mon Nov 18, 2002 3:12 pm    Post subject: Reply with quote

One might add that if you use @name and @ext() to retrieve the two portions of the datetime value,
you should be sure to set
Code:
OPTION DECIMALSEP,"."

otherwise it will only work on systems using a point as the decimal separator.

Also it could be interesting to notice that day zero here is the 30th of December 1899 - not many computers
running back then when Mac and I were kids.... Wink Very Happy

Greetz
Dr. Dread

_________________
~~ 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
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Nov 19, 2002 12:16 am    Post subject: Reply with quote

Thanks for "pointing" that out dread (pun intended)... Wink

I added that to the post along with a reminder about
the possibility of too many digits when doing math
with @datetime() floats. Someone had posted/solved
a problem with that (Serge maybe?)...

Dr. Dread wrote:

Also it could be interesting to notice that day zero here is the 30th of December 1899 - not many computers
running back then when Mac and I were kids....

LOL, yeah - and flying the kite in a storm to charge the
laptop battery was a real pain... Razz Laughing

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Nov 22, 2002 9:40 am    Post subject: Reply with quote

Thanks for your post Mac - i had often wondered how the @datetime() number was configured and what constituted 1 sec.

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base 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