Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-08-19
21:12 • Closed ticket [219242ffff]: clock scan fails with certain times plus 7 other... artifact: be69102ebb user: kennykb
2001-02-17
03:03 • Ticket [219242ffff]: 4 changes artifact: 83755fe7d0 user: kennykb
2001-02-08
13:46 • Ticket [219242ffff]: 2 changes artifact: ff85d98ef7 user: dgp
2000-10-26
05:04 • New ticket [219242ffff]. artifact: 18e8d0d257 user: nobody

clock scan fails with certain times

Closed / Wont Fix219242ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 22 years ago
Descriptionplain2000-10-26 05:04:04
OriginalBugID: 5208 Bug
Version: 8.3
SubmitDate: '2000-04-20'
LastModified: '2000-06-26'
Severity: LOW
Status: Assigned
Submitter: techsupp
ChangedBy: ericm
RelatedBugIDs: 2732 6106
OS: All
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


Name:
Devin Eyre

Extensions:
Oratcl2.5

Comments:
The command works for times less than 0024, and times greater than 0059.
    It worked fine in tclsh8.2
    A workaround I've found is to insert a colon in the middle of the time.
    I tried to search your bug database for this, but it wasn't working at
    the time.

ReproducibleScript:
clock scan "tomorrow 0024"

ObservedBehavior:
unable to convert date-time string "tomorrow 0024"

DesiredBehavior:
956358060



Verified with 8.3.0.  The problem is in the clock scan parser.  All numbers with fewer than 6 digits are treated as UNUMBER tokens.  The parser is then left to determine, from the magnitude of the number, whether it includes an hour component and a minute component, or just an hour component.  The test used to make this determination is:

$1 < 100

This works for times after 1:00am (as they would all be expressed in 24hr format as 01xx, which is greater than 100), but not for times between 0000 and 0059.  Times less than 0024 are processed, but incorrectly:  instead of 00:23 (for example), they are interpreted as 23:00.  This is not correct behavior.

Fixing this requires extending the parser to discriminate between 4-/3-digit numbers and 2-/1-digit numbers.  4 or 3 digit numbers include a two digit minute component; 2 or 1 digit numbers do not.

- eric

-- 04/20/2000 ericm
dgp Ticket [219242ffff]: 2 changes [History diff]2001-02-08 13:46:44
kennykbplain2001-02-17 03:03:34
"Arthur.Taylor" <[email protected]> reports the same problem.
kennykbplain2004-08-19 21:12:36
Logged In: YES 
user_id=99768

Free-format scan is deprecated in 8.5 in favor of fixed-format
scan.  Scanning with a fixed format eliminates the many
ambiguities associated with numbers (a four digit number
can be a time of day, a time zone offset, a quantity, or a
year).
Given the deprecation of free format, this bug is unlikely to be
fixed.
Log in (anonymous is fine) to add a comment.