View previous topic :: View next topic |
Author |
Message |
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Nov 18, 2002 12:26 pm Post subject: @datetime() float info... |
|
|
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 _________________ 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 |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Nov 18, 2002 3:12 pm Post subject: |
|
|
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....
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Nov 19, 2002 12:16 am Post subject: |
|
|
Thanks for "pointing" that out dread (pun intended)...
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...
Cheers, Mac _________________ 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 |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Nov 22, 2002 9:40 am Post subject: |
|
|
Thanks for your post Mac - i had often wondered how the @datetime() number was configured and what constituted 1 sec.
Serge _________________
|
|
Back to top |
|
|
|