[ZCM] [ZC] 2349/ 1 Request "DateTime.DateTime incorrect addition with timezones"
"Collector: Zope Bugs, Features, and Patches ..." <[email protected]> Sat, 25 Aug 2007 22:23:58 -0400
| Newsgroups | gmane.comp.web.zope.devel.collector-monitor |
|---|---|
| Message-ID | <[email protected]> |
Issue #2349 Update (Request) "DateTime.DateTime incorrect addition with timezones"
Status Pending, Zope/bug medium
To followup, visit:
http://www.zope.org/Collectors/Zope/2349
==============================================================
= Request - Entry #1 by bonafide on Aug 25, 2007 10:23 pm
The code snippets below both try to add 31 days to the first day in October 31. I'm expecting this to result in the first day of November (2005/11/1)
Valid behavior:
>>> from DateTime import DateTime
>>> start=DateTime('2005/10/01 01:00:00 GMT-5')
>>> print start
2005/10/01 01:00:00 GMT-5
>>> earlyStart=start.earliestTime()
>>> print earlyStart
2005/10/01
>>> print earlyStart+31
2005/11/01
Invalid behavior: (Here's the problem)
>>> from DateTime import DateTime
>>> start=DateTime('2005/10/01 01:00:00 US/Central')
>>> print start
2005/10/01 01:00:00 US/Central
>>> earlyStart=start.earliestTime ()
>>> print earlyStart
2005/10/01
>>> print earlyStart+31
2005/10/31 23:00:00 US/Central
I've confirmed this occurs when using the US/ timezones (US/Pacific, US/Alaska, etc)
As you can see, the resulting date is coming up 1 hour short of the expected 2005/11/01.
This problem is known to cause certain products to deadlock a zope instance.
==============================================================