Results 1 to 3 of 3

Thread: DT_DateTimeSubSeconds breaking in late December

Share/Bookmark
  1. #1

    DT_DateTimeSubSeconds breaking in late December

    Here's a fun one:

    Watch what happens to the result when the day goes from December 29th to December 30th.

    I also tried adding -1 second with a different result.

    ----8<-------------------------------------------------------
    Dim date, time As String
    '---Load Console and DT Modules
    Uses "Console"
    Uses "dt"

    '--- These are the strings
    date="12-29-2016"
    time="15:38:44"
    PrintL DT_DateTimeSubSeconds(date,time,1) '--- subtract a second

    '--- Advance the date
    date="12-30-2016"
    PrintL DT_DateTimeSubSeconds(date,time,1) '--- whoopsie!
    PrintL DT_DateTimeAddSeconds(date,time,-1) '--- add (-1) second -- oof!

    WaitKey
    ------------------------------------------------------->8----

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,712
    Blog Entries
    3
    Rep Power
    684
    Oh noes,

    thanks for reporting this, this is a bug indeed!


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  3. #3
    I was confounded by the differing results between the DT_DateTimeAddSeconds and DT_DateTimeSubSeconds functions. I assumed they would give identical results (right or wrong) as they do when the bug isn't in play.

Similar Threads

  1. Declarations: Local early and late binding
    By Charles Pegge in forum O2h Compiler
    Replies: 0
    Last Post: 22-07-2009, 20:11
  2. Important decision ( done late )
    By Petr Schreiber in forum TBGL module by Petr Schreiber
    Replies: 6
    Last Post: 12-05-2008, 23:03

Posting Permissions

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