Results 1 to 10 of 10

Thread: DT_DateToSec

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    DT_DateToSec

    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

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: DT_DateToSec

    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

  3. #3
    Member
    Join Date
    Jul 2010
    Location
    Phoenix, Arizona, usa
    Age
    74
    Posts
    54
    Rep Power
    19

    Unhappy DT_DateToSec and DT_SecTo_Date Only Seem To Work for > 4 A.D. or so

    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.

  4. #4
    Member
    Join Date
    Jul 2010
    Location
    Phoenix, Arizona, usa
    Age
    74
    Posts
    54
    Rep Power
    19

    Question Can we fIx this bug?

    Can this be fixed?
    Also how can I confirm that the datetosec and sectodate formulas are working correctly for dates after Jan 1, 1970 ?

  5. #5
    Member
    Join Date
    Jul 2010
    Location
    Phoenix, Arizona, usa
    Age
    74
    Posts
    54
    Rep Power
    19

    Where can I get info on the DT_DateToSec & DT_SecToDate formulas

    Any info on this?

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    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

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •