Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 67b27b9c4a5460859546c85234947060d3f36306
Ticket: 219337ffffffffffffffffffffffffffffffffff
clock scan - timezones like +200 generate error
User & Date: nobody on 2000-10-26 05:10:57
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 5297 Bug
    Version: 8.3
    SubmitDate: '2000-04-28'
    LastModified: '2000-06-26'
    Severity: SER
    Status: UnAssn
    Submitter: techsupp
    ChangedBy: ericm
    RelatedBugIDs: 4862
    OS: All
    OSVersion: NT 4.0,  RedHat Linux 6.2, AIX 4.1
    Machine: various IBM PCs, IBM RS/6000
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    Name:
    
    Borivoj Tydlitat
    
    
    Extensions:
    
    none in this case
    
    
    CustomShell:
    
    no
    
    
    Comments:
    
    The above yacc grammar has two branches with hard-coded '-' sign before
    
        TZ offset. 
    
        Just added two more with '+' sign.
    
    
    ReproducibleScript:
    
    % clock scan {3/1 12:00 est}
    
    951930000
    
    % clock scan {3/1 18:00 cet}
    
    951930000
    
    % clock scan {3/1 12:00 -0500}
    
    951930000
    
    % clock scan {3/1 18:00 +0100}
    
    unable to convert date-time string "3/1 18:00 +0100"
    
    
    ObservedBehavior:
    
    Error converting times with timezone expressed as positive hhmm offset: +hmm (i.e. eastern hemisphere timezones).
    
    Timezones with negative offset, symbolic names or military codes seem to work OK.
    
    
    DesiredBehavior:
    
    Apparently the date/time formats covered by the clock scan command attempt to conform to RFC 822. Therefore timezone fields like +1100  should be processed the same way e.g. -0500 is, and not be rejected as incorrect format.
    
    
    Patch:
    
    *** tclGetDate.y.old    Fri Apr 28 13:28:21 2000
    
    --- tclGetDate.y        Fri Apr 28 13:30:28 2000
    
    ***************
    
    *** 205,210 ****
    
    --- 205,217 ----
    
                  yyDSTmode = DSToff;
    
                  yyTimezone = ($5 % 100 + ($5 / 100) * 60);
    
              }
    
    +         | tUNUMBER ':' tUNUMBER '+' tUNUMBER {
    
    +             yyHour = $1;
    
    +             yyMinutes = $3;
    
    +             yyMeridian = MER24;
    
    +             yyDSTmode = DSToff;
    
    +             yyTimezone = -($5 % 100 + ($5 / 100) * 60);
    
    +         }
    
              | tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid {
    
                  yyHour = $1;
    
                  yyMinutes = $3;
    
    ***************
    
    *** 219,225 ****
    
                  yyDSTmode = DSToff;
    
                  yyTimezone = ($7 % 100 + ($7 / 100) * 60);
    
              }
    
    !         ;
    
    
      zone    : tZONE tDST {
    
                  yyTimezone = $1;
    
    --- 226,240 ----
    
                  yyDSTmode = DSToff;
    
                  yyTimezone = ($7 % 100 + ($7 / 100) * 60);
    
              }
    
    !         | tUNUMBER ':' tUNUMBER ':' tUNUMBER '+' tUNUMBER {
    
    !             yyHour = $1;
    
    !             yyMinutes = $3;
    
    !             yySeconds = $5;
    
    !             yyMeridian = MER24;
    
    !             yyDSTmode = DSToff;
    
    !             yyTimezone = -($7 % 100 + ($7 / 100) * 60);
    
    !         }
    
    !       ;
    
    
      zone    : tZONE tDST {
    
                  yyTimezone = $1;
    
    
    PatchFiles:
    
    generic/tclGetDate.y
    
    
    
    
    There is a backwards compatibility issue with this change.  Prior to using it:
    
    % clock scan "12:00 +1000 seconds"
    962047000
    
    After applying it:
    
    % clock scan "12:00 +1000 seconds"
    961984801
    
    The grammar is such that the "+1000" is greedily consumed as a timezone for "12:00" rather than a multiplier for "seconds".  This may be fixable with a better grammar; really, as I've said before, the clock grammar needs a complete overhaul (13 shift/reduce conflicts is obscene).
    
    - eric
    
    -- 06/26/2000 ericm
    
    
    
  4. foundin changed to: "obsolete: 8.3"
  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: "48. Number Handling"
  10. title changed to: "clock scan - timezones like +200 generate error"
  11. type changed to: "Bug"