Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-05
06:56 • Ticket [219026ffff] Daylight Savings Time goof status still Closed with 3 ot... artifact: 999c7d3336 user: dgp
2000-10-26
08:34 • Closed ticket [219026ffff]. artifact: a249ba6374 user: welch
01:09 • New ticket [219026ffff]. artifact: ab6b5c77f0 user: nobody

Daylight Savings Time goof

Closed / Fixed219026ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:09:36
OriginalBugID: 4022 Bug
Version: 8.3b1
SubmitDate: '2000-01-14'
LastModified: '2000-01-14'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: ericm
OS: All
FixedDate: '2000-01-14'
FixedInVersion: 8.3b2
ClosedDate: '2000-10-25'


Name:

Don Porter



CVS:

$Id: clock.test,v 1.8 2000/01/13 00:12:33 ericm Exp $



Comments:

This bug report is really for Tcl 8.3b2.  The bug form

needs updating.



The tests for the new handling of a relative

[clock scan] which crosses a Daylight Savings Time boundary

are "hard coded" to the PST time zone.  In PST, they test

relative scans between 1999 Oct 31 00:00:00 PST and

1999 Nov 1 00:00:00 PST, which in fact straddle a DST boundary.



In EST, those times are 1999 Oct 31 02:00:00 and

1999 Nov 1 03:00:00, which do not straddle a DST boundary.



The patch changes the tests so they work relative to

the local time zone.  I think they'll work anywhere now.

I'm curious whether the revised tests will work properly

in jurisdictions like Indiana or Arizona which do not

observe DST.  A test there would be appreciated.



ObservedBehavior:

$ make test

==== clock-4.25 clock scan, DST for days FAILED

==== Contents of test case:



    clock scan "tomorrow" -base 941353200



---- Result was:

941439600

---- Result should have been:

941443200

==== clock-4.25 FAILED





==== clock-4.26 clock scan, DST for days FAILED

==== Contents of test case:



    clock scan "yesterday" -base 941443200



---- Result was:

941356800

---- Result should have been:

941353200

==== clock-4.26 FAILED



DesiredBehavior:

No test suite failures.



Patch:

Index: clock.test

===================================================================

RCS file: /cvsroot/tcl/tests/clock.test,v

retrieving revision 1.8

diff -c -r1.8 clock.test

*** clock.test  2000/01/13 00:12:33     1.8

--- clock.test  2000/01/14 17:19:50

***************

*** 221,231 ****

            -format {%b %d, %Y %H:%M:%S} -gmt true

  } "Dec 31, 1999 08:00:30"

  test clock-4.25 {clock scan, DST for days} {

!     clock scan "tomorrow" -base 941353200

! } 941443200

  test clock-4.26 {clock scan, DST for days} {

!     clock scan "yesterday" -base 941443200

! } 941353200

  test clock-4.27 {clock scan, day} knownBug {

      clock format [clock scan "Monday" -gmt true -base 946627200] \

            -format {%b %d, %Y %H:%M:%S} -gmt true

--- 221,233 ----

            -format {%b %d, %Y %H:%M:%S} -gmt true

  } "Dec 31, 1999 08:00:30"

  test clock-4.25 {clock scan, DST for days} {

!     clock format [clock scan tomorrow \

!           -base [clock scan "1999-10-31 00:00:00"]] -format %H

! } 00

  test clock-4.26 {clock scan, DST for days} {

!     clock format [clock scan yesterday \

!           -base [clock scan "1999-11-01 00:00:00"]] -format %H

! } 00

  test clock-4.27 {clock scan, day} knownBug {

      clock format [clock scan "Monday" -gmt true -base 946627200] \

            -format {%b %d, %Y %H:%M:%S} -gmt true



PatchFiles:

tests/clock.test





Yes, the tests were hardcoded for PST.  I applied your patch, with minor modification (I dropped the -format %H and made the expected result [clock scan "19991101 00:00:00"] to be sure we were getting the correct numbers).

- eric

-- 01/14/2000 ericm
welch Closed ticket [219026ffff]. [History diff]2000-10-26 08:34:04
dgp Ticket [219026ffff]: 3 changes [History diff]2001-04-05 06:56:32
Log in (anonymous is fine) to add a comment.