From: SourceForge.net <no...@so...> - 2007-07-01 23:15:58
|
Bugs item #1746193, was opened at 2007-07-01 22:44 Message generated for change (Settings changed) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1746193&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: 06. Time Measurement Group: development: 8.5a7 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andy Goth (andygoth) Assigned to: Kevin B KENNY (kennykb) Summary: [clock add] month miscalculation in Chicago time Initial Comment: 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. ---------------------------------------------------------------------- Comment By: Andy Goth (andygoth) Date: 2007-07-01 23:17 Message: 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. ---------------------------------------------------------------------- Comment By: Andy Goth (andygoth) Date: 2007-07-01 22:48 Message: Logged In: YES user_id=8653 Originator: YES This problem exists in today's HEAD. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1746193&group_id=10894 |