Skip to content
Tcl Source Code View Ticket
Login

View Ticket

clock scan adjustment errors when using gmt setting

Closed / Fixed218510ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:01:29
OriginalBugID: 784 Bug
Version: 8.0.3
SubmitDate: '1998-11-02'
LastModified: '2000-01-12'
Severity: SER
Status: Released
Submitter: pat
ChangedBy: hobbs
RelatedBugIDs: 740
OS: Windows NT
OSVersion: sp3 and AIX
FixedDate: '2000-01-12'
FixedInVersion: 8.3b2
ClosedDate: '1999-10-29'


From: [email protected]

ReproducibleScript:
Running on AIX
% clock format [clock scan "oct 1, 1998 12:00am 1 month"]
Sun Nov 01 00:00:00 PST 1998
% clock format [clock scan "oct 1, 1998 12:00am 1 month" -gmt 1] -gmt 1
Sat Oct 31 01:00:00 PST 1998
% puts $tcl_version
8.0

running on Win32 (NT4 SP4)
% clock format [clock scan "oct 1, 1998 12:00am 1 month"]
Sun Nov 01 00:00:00 Pacific Daylight Time 1998
% clock format [clock scan "oct 1, 1998 12:00am 1 month" -gmt 1] -gmt 1
Sat Oct 31 01:00:00 Pacific Daylight Time 1998
% puts $tcl_version
8.0

ObservedBehavior:
in order to get around the following problem of day based adjustments being
affected by daylight savings time
% clock format [clock scan "oct 25, 1998 12:00am 1 day"]
Sun Oct 25 23:00:00 Pacific Daylight Time 1998
% clock format [clock scan "oct 25, 1998 12:00am 1 week"]
Sat Oct 31 23:00:00 Pacific Daylight Time 1998
% clock format [clock scan "oct 25, 1998 12:00am 1 month"]
Wed Nov 25 00:00:00 Pacific Daylight Time 1998

i tried to use GMT everywhere, but the adjustment by 1 month does not work right.

DesiredBehavior:
% clock format [clock scan "oct 1, 1998 12:00am 1 month"]
Sun Nov 01 00:00:00 Pacific Daylight Time 1998
% clock format [clock scan "oct 1, 1998 12:00am 1 month" -gmt 1] -gmt 1
Sun Nov 01 00:00:00 Pacific Daylight Time 1998

Comments:
the command 
% clock format [clock scan "oct 25, 1998 12:00am 24 hours"]
Sun Oct 25 23:00:00 Pacific Daylight Time 1998

would be fine, but I think that
% clock format [clock scan "oct 25, 1998 12:00am 1 day"]
should yield
Sun Oct 26 00:00:00 Pacific Daylight Time 1998



The -gmt setting was fixed in 8.1. 
-- 10/29/1999 hobbs
OK, the clock DST corrections were redone for 8.3b2 to work as
expected (desired above).  Note that the user comments that
they want:

  % clock format [clock scan "oct 25, 1998 12:00am 1 day"]
  should yield
  Sun Oct 26 00:00:00 Pacific Daylight Time 1998

When it now returns:

(win) 49 % clock format [clock scan "oct 25, 1998 12:00am 1 day"]
Mon Oct 26 00:00:00 Pacific Standard Time 1998
(win) 50 % clock format [clock scan "oct 25, 1998 12:00am 24 hours"]
Sun Oct 25 23:00:00 Pacific Standard Time 1998

The different TZ is all that differs, but that is what is correct. 
-- 01/12/2000 hobbs
welch Closed ticket [218510ffff]. [History diff]2000-10-26 08:23:19
dgp Ticket [218510ffff]: 3 changes [History diff]2001-04-05 06:56:33
Log in (anonymous is fine) to add a comment.