Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f095a03ea563cfd276f8143168b59fff3a8b50ad9a58c4e624baf8c04b4fc17e
Ticket: f2b5f89c0d8520ea86b929daa19ec13fc3a24d2d
clock scan of leapsecond: wrong result in 8.6 and 9.0
User & Date: jan.nijtmans on 2024-11-14 16:47:34
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    First, have a look at Tcl 8.7:
    <pre>
    $ tclsh8.7
    % clock scan "2012-06-30 23:59:59" -gmt 1
    1341100799
    % clock scan "2012-06-30 23:59:60" -gmt 1
    1341100800
    </pre>
    This is correct. The 30th of june in 2012 had a leap second, so it - indeed - had a sixtieth second.
    
    Now Tcl 9.0:
    <pre>
    $ tclsh9.0
    % clock scan "2012-06-30 23:59:59" -gmt 1
    1341100799
    % clock scan "2012-06-30 23:59:60" -gmt 1
    unable to convert input string: invalid time
    </pre>
    Understandable, but incorrect: this is a valid timestamp. See: [https://en.wikipedia.org/wiki/Leap_second|Leap_second]
    
    Finally, Tcl 8.6:
    <pre>
    $ tclsh8.6
    % clock scan "2012-06-30 23:59:59" -gmt 1
    1341100799
    % clock scan "2012-06-30 23:59:60" -gmt 1
    1341014399
    % clock format 1341014399 -gmt 1
    Fri Jun 29 23:59:59 GMT 2012
    </pre>
    So, adding a single second ends up on the previous day.
    
  5. foundin changed to: "8.6, 9.0"
  6. is_private changed to: "0"
  7. login: "jan.nijtmans"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "0c50e5320704d174412e57b873d8932de15303e0"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "jan.nijtmans"
  14. subsystem changed to: "16. Commands A-H"
  15. title changed to:
    clock scan of leapsecond: wrong result in 8.6 and 9.0
    
  16. type changed to: "Bug"