Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5b54c9daff5fa1cf0b9ebeb68d25b05ebee64a7e
Ticket: 1075433fffffffffffffffffffffffffffffffff
clock scan does not handle all ISO 8601 time formats
User & Date: nobody on 2004-11-29 18:08:54
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The man pages for clock scan command implies that you 
    can read a ISO 8601 point-in-time specifications. I 
    looked at the specification and examples from , 
    http://www.w3.org/TR/NOTE-datetime , and find that 
    not all case are able to be parsed (in Tcl 8.4.8). 
    
    See test the results below:
    
    Year:
    # YYYY (eg 1997)
    % clock format [clock scan 1997]
        unable to convert date-time string "1997"
    
    Year and month:
    # YYYY-MM (eg 1997-07)
    % clock format [clock scan 1997-07]
       unable to convert date-time string "1997-07"
    
    Complete date:
    # YYYY-MM-DD (eg 1997-07-16)
    % clock format [clock scan 1997-07-16]
       Wed Jul 16 12:00:00 AM Eastern Daylight Time 1997
     
    Complete date plus hours and minutes:
    # YYYY-MM-DDThh:mmTZD (eg 1997-07-
    16T19:20+01:00)
    % clock format [clock scan 1997-07-16T19:20+01:00]
       unable to convert date-time string "1997-07-
    16T19:20+01:00"
    
    # but if we remove the time zone offset it works but is 
    one hour to fast!!!
    % clock format [clock scan 1997-07-16T19:20]
       Wed Jul 16 8:20:00 AM Eastern Daylight Time 1997
    
    # removing the T gives us the correct time ?? strange
    % clock format [clock scan "1997-07-16 19:20"]
       Wed Jul 16 7:20:00 PM Eastern Daylight Time 1997
    
    # also if we remove the dashes and leave the T
    % clock format [clock scan "19970716T19:20:00"]
       Wed Jul 16 7:20:00 PM Eastern Daylight Time 1997
    
    Complete date plus hours, minutes and seconds:
    # YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-
    16T19:20:30+01:00)
    % clock format [clock scan 1997-07-
    16T19:20:30+01:00]
        unable to convert date-time string "1997-07-
    16T19:20:30+01:00"
    
    Complete date plus hours, minutes, seconds and a 
    decimal fraction of a second
    # YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-
    16T19:20:30.45+01:00)
    % clock format [clock scan 1997-07-
    16T19:20:30.45+01:00]
       unable to convert date-time string "1997-07-
    16T19:20:30.45+01:00"
    
    where:
     YYYY = four-digit year
     MM   = two-digit month (01=January, etc.)
     DD   = two-digit day of month (01 through 31)
     hh   = two digits of hour (00 through 23) (am/pm NOT 
    allowed)
     mm   = two digits of minute (00 through 59)
     ss   = two digits of second (00 through 59)
     s    = one or more digits representing a decimal fraction 
    of a second
     TZD  = time zone designator (Z or +hh:mm or -hh:mm)
    
    
    Mike Jacobson
    [email protected]
    
  4. foundin changed to: "obsolete: 8.4.8"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "16. Commands A-H"
  10. title changed to:
    clock scan does not handle all ISO 8601 time formats
    
  11. type changed to: "Bug"