Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fe64c2bfc48f6424aeaf61eabc3317a434ee6810
Ticket: 1929060fffffffffffffffffffffffffffffffff
[clock scan] gets confused by [clock format]
User & Date: andygoth on 2008-03-30 01:18:05
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Run the following two commands in a fresh tclsh:
    
    % clock format 0 -format "%D %H:%M:%S"
    % clock scan "01/01/1970 00:00:00"\
       -format "%m/%d/%Y %H:%M:%S"
    
    The following error is returned:
    
    input string does not match supplied format
        while executing
    "$scanner $string $base $timezone"
        (procedure "::tcl::clock::scan" line 82)
        invoked from within
    "clock scan "01/01/1970 00:00:00"\
       -format "??/??/210 H:M:0x00000000""
        ("uplevel" body line 1)
        invoked from within
    "uplevel #0 clock\ scan\ \"01/01/1970\ 00:00:00\"\\\n\ \ \ -format\ \"??/??/210\ H:M:0x00000000\""
    
    Now start another tclsh and run the following three commands:
    
    % clock scan "01/01/1970 00:00:00"\
       -format "%m/%d/%Y %H:%M:%S"
    % clock format 0 -format "%D %H:%M:%S"
    % clock scan "01/01/1970 00:00:00"\
       -format "%m/%d/%Y %H:%M:%S"
    
    No error is returned; instead, 21600 is returned, as expected.
    
    It looks like running [clock format] before the first [clock scan] can potentially screw up the internal state of the [clock] command.
    
    This problem was originally discovered by Peter Turner.  His email address is similar to Peter.Turner@com!forthc  .  He experienced it when using my timebox command, found at http://andy.junkdrome.org/devel/timebox/ .
    
  4. foundin changed to: "obsolete: 8.5.2"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "andygoth"
  10. subsystem changed to: "16. Commands A-H"
  11. title changed to: "[clock scan] gets confused by [clock format]"
  12. type changed to: "Bug"