Artifacts Associated With Ticket 1746193fffffffffffffffffffffffffffffffff
Ticket change [30ee18d61b] (rid 93338) by andygoth on 2007-07-01 21:44:08:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
In the Chicago (Central) time zone, [clock add] can miscalculate month addition and subtraction: [clock format [clock add [clock scan "May 01 00:00:00 1970" -timezone :UTC] 1 month] -timezone :UTC] returns "Sun May 31 00:00:00 UTC 1970" [clock format [clock add [clock scan "May 31 00:00:00 1970" -timezone :UTC] -1 month] -timezone :UTC] returns "Fri May 01 00:00:00 UTC 1970" Changing the time zone to UTC or CEST fixes the problem: [clock format [clock add [clock scan "May 01 00:00:00 1970" -timezone :UTC] 1 month] -timezone :UTC] returns "Mon Jun 01 00:00:00 UTC 1970" Probably other time zones work as well. It's also possible other time zones are broken. It could be that the Chicago time zone is only broken when in Daylight Saving time. This occurs in both Slackware Linux and MS-Windows XP.
- foundin initialized to: "obsolete: 8.5a7"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "andygoth"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "[clock add] month miscalculation in Chicago time"
- type initialized to: "Bug"
Ticket change [9174197b82] (rid 120619) by andygoth on 2007-07-02 04:48:04:
- assignee changed to: "kennykb"
- icomment:
Logged In: YES user_id=8653 Originator: YES This problem exists in today's HEAD.
- login: "andygoth"
- mimetype: "text/plain"
- username: "andygoth"
Ticket change [f02d74bb33] (rid 109142) by andygoth on 2007-07-02 05:17:03:
- icomment:
Logged In: YES user_id=8653 Originator: YES The problem appears to be in [clock add]. [clock scan] and [clock format] generate the right results, of course assuming GNU date is right. :^) [clock add 12960000 -1 month] returns 10368000, which is May 1. It should return 10281600, or Apr 30. The two values differ by 86400, one day. Hmm, come to think of it... [clock add] takes a -timezone argument as well. Passing in -timezone :UTC to [clock add] makes it return 10281600, the expected result. I'm unsure why the -timezone argument matters in this case, though. This may still bear investigation.
- login: "andygoth"
- mimetype: "text/plain"
- username: "andygoth"
- icomment:
Ticket change [5c3a2b6cac] (rid 115262) by dkf on 2007-07-02 06:15:59:
- subsystem changed to: "06. Time Measurement"
Ticket change [de9483c31a] (rid 114875) by kennykb on 2007-09-04 03:56:11:
- closedate changed to: "2007-09-03T20:56:11"
- closer changed to: "kennykb"
- icomment:
Logged In: YES user_id=99768 Originator: NO I can't find a bug here. [clock add] operates in the given timezone - in your case :America/Chicago. In Chicago time, 12960000 is Sat May 30 19:00:00 CDT 1970 Subtracting 1 month yields % clock add 12960000 -1 month -timezone :America/Chicago 10368000 % clock format 10368000 -timezone :America/Chicago Thu Apr 30 19:00:00 CDT 1970 which is 1 month before the given date in Chicago time. By contrast, in UTC, we have: % clock format 12960000 -gmt 1 Sun May 31 00:00:00 GMT 1970 Subtracting 1 month yields the invalid date April 31, which gets trimmed to April 30: % clock add 12960000 -1 month -gmt 1 10281600 % clock format 10281600 -gmt 1 Thu Apr 30 00:00:00 GMT 1970 All of which is exactly as I expect.
- login: "kennykb"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Pending"
- username: "kennykb"
Ticket change [bf76dad3bf] (rid 102257) by sf-robot on 2007-09-18 09:20:05:
- closedate changed to: "2007-09-18T02:20:05"
- closer changed to: "sf-robot"
- icomment:
Logged In: YES user_id=1312539 Originator: NO This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"