|
2001-04-05
| ||
| 06:56 | • Ticket [218981ffff] clock scan tomorrow fails to handle daylight savings time ch... artifact: fbf706a4db user: dgp | |
|
2000-10-26
| ||
| 08:33 | • Closed ticket [218981ffff]. artifact: d35191e465 user: welch | |
| 01:08 | • New ticket [218981ffff]. artifact: e517210df2 user: nobody | |
clock scan tomorrow fails to handle daylight savings time ch
Closed / Fixed218981ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:08:54
OriginalBugID: 3441 Bug
Version: 8.1.1
SubmitDate: '1999-11-05'
LastModified: '2000-01-12'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: ericm
OS: Other
OSVersion: BSD/OS 4.0.1
FixedDate: '2000-01-12'
FixedInVersion: 8.3b2
ClosedDate: '2000-10-25'
Name: Robert Hare
Comments:
In our case we are setting timers to go off exactly at midnight each
day. We use tomorrow to
calculate the # of milleseconds to set the clock. One workaround is to
do all calculations and use
noon as the basis for date caluculations. This allows for the needed
margin for daylight savings
time changes as well as leap second changes.
Some sample code:
set t [clock scan "[clock format [clock seconds] -format "%m/%d/%Y"]
12:00:00"
clock scan "[clock format [expr $t + 86400] -format "%m/%d/%Y"]
00:00:00"
Happy Halloween, this problem will occur this Sunday. :-(
ReproducibleScript:
The "clock scan tomorrow" function will fail from 00:00 - 01:00 when
going off daylight savings time.
I suspect that other relative time functions (such as yesterday) will
also have problems with daylight
savings time transition days.
To duplicate:
% date 199910310000 - Set the system clock.
% date - Confirm date set
correctly.
Sun Oct 31 00:00:03 MDT 1999
% tclsh8.1 - Enter Tcl
% clock seconds - Get the clock value
941349616
% clock scan tomorrow - Get clock value for tomorrow
941436024
% exit - Exit Tcl
% date -r 941436024 - Display clock value from "clock
scan tomorrow".
Sun Oct 31 23:00:24 MST 1999 - Notice it's not tomorrow, but simply
86400 seconds in future.
ObservedBehavior:
Receive a clock value for the same day. (86400 secons later)
DesiredBehavior:
Expect to receive a clock value for tomrrow.
There was a bug in our handling of relative times for periods crossing the daylight savings time boundary. The bug has been fixed in 8.3b2:
% clock format [clock scan tomorrow -base [clock scan 1999-10-31]]
Mon Nov 01 00:00:00 PST 1999
- eric
-- 01/12/2000 ericm
welch Closed ticket [218981ffff].
[History diff]2000-10-26 08:33:07
dgp Ticket [218981ffff]: 3 changes
[History diff]2001-04-05 06:56:32
Log in (anonymous is fine) to add a comment.