Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b4328a74126caea825c325ab8b1f9e9c3674fc19c12ec0dacde897326ea9dcde
Ticket: f2b5f89c0d8520ea86b929daa19ec13fc3a24d2d
clock scan of leapsecond: wrong result in 8.6 and 9.0
User & Date: sebres on 2024-11-21 17:19:16
Changes

  1. icomment:
    > No, it doesn't do that any more. I found a solution for that.<br/>
    > without jumping to the next day any more.
    
    No, you did not:
    
    ```
    % clock format [clock scan "Jun 30 23:59:60 GMT 2012"] -gmt 1
    Sun Jul 01 00:00:00 GMT 2012
    % clock format [clock scan "Jul 01 01:59:60 CEST 2012"] -gmt 1
    Sun Jul 01 00:00:00 GMT 2012
    
    % clock format [clock scan "Jan 01 00:59:60 CET 2017" -gmt 1] -gmt 1
    Sun Jan 01 00:00:00 GMT 2017
    % clock format [clock scan "Dec 31 23:59:60 GMT 2016" -gmt 1] -gmt 1
    Sun Jan 01 00:00:00 GMT 2017
    ```
    this is definitely next day and month (and next year for the latter).
    
    > % clock scan "Fri Jun 29 23:59:60 GMT 2012"<br/>
    > unable to convert input string: invalid time<br/>
    > As expected
    
    Well, related your code, you [allowed only Jan 01 and Jul 01](./file?name=generic/tclClock.c&ci=d3744ffffc620ecc&ln=3842-3845)... Then it'd cause another issues, I guess...<br/>
    And how about this (what shall fail in GMT, since it is not leap sec there):
    ```
    % clock scan "Jan 01 23:59:60 GMT 2013"
    1357084800
    ```
    The major issue is that the validation happens in 2 stages, one before local time in UTC conversion and another after. And the obtaining of new tokens happens on demand, depending on several parameters (like `CLF_ASSEMBLE_*`) and input tokens (like `CLF_JULIANDAY`), which may be missed by some constellations and the check as you organized it may be wrong. Especially if you'd fix above-mentioned issue with switch to next day/month/year.
    
  2. login: "sebres"
  3. mimetype: "text/x-markdown"