I was looking at DT_DateToSec and was wondering where it does its calculation from is it 01-01-1970 or 01-01-1900 or ??
I was looking at DT_DateToSec and was wondering where it does its calculation from is it 01-01-1970 or 01-01-1900 or ??
Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370
As far as I know it starts from date "01-01-0000" so from the first day of the first month of year zero.
Roberto will be more precise.
Number of seconds of the very first day:
uses "Console", "dt" printl DT_DateToSec("01-01-0000") waitkey
Last edited by ErosOlmi; 23-04-2011 at 19:19.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Subj: DT_DateToSec and DT_SecTo_Date Only Seem To Work for > 4 A.D. or so.
If you try the following tb script the functions
DT_DateToSec and DT_SecTo_Date
only seem to work for > 4 A.D. or so.
'===================================================== uses "console","dt" console_write "01-01-1970 -> " & dt_datetosec("01-01-1970") & $CRLF console_write "01-01-0004 -> " & dt_datetosec("01-01-0004") & $CRLF console_write "01-01-0001 -> " & dt_datetosec("01-01-0001") & $CRLF console_write "01-01-0000 -> " & dt_datetosec("01-01-0000") & $CRLF console_write "63000000000 secs -> " & dt_sectodate(63000000000) & $CRLF console_write "10000000000 secs -> " & dt_sectodate(10000000000) & $CRLF console_write "1000000000 secs -> " & dt_sectodate(1000000000) & $CRLF console_write "100000000 secs -> " & dt_sectodate(100000000) & $CRLF console_write "10000000 secs -> " & dt_sectodate(10000000) & $CRLF console_write "1000000 secs -> " & dt_sectodate(1000000) & $CRLF console_write "100000 secs -> " & dt_sectodate(100000) & $CRLF console_write "10000 secs -> " & dt_sectodate(10000) & $CRLF console_write "1000 secs -> " & dt_sectodate(1000) & $CRLF console_write "100 secs -> " & dt_sectodate(100) & $CRLF console_write "10 secs -> " & dt_sectodate(10) & $CRLF console_write "1 secs -> " & dt_sectodate(1) & $CRLF console_write "0 secs -> " & dt_sectodate(0) & $CRLF console_waitkey '===================================================
Last edited by ErosOlmi; 26-04-2011 at 20:39.
Can this be fixed?
Also how can I confirm that the datetosec and sectodate formulas are working correctly for dates after Jan 1, 1970 ?
Any info on this?
I will check this night when back home
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks