DateTime.DateTime incorrect addition with timezones
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DateTime |
Invalid
|
Medium
|
Unassigned |
Bug Description
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(
>>> print start
2005/10/01 01:00:00 GMT-5
>>> earlyStart=
>>> print earlyStart
2005/10/01
>>> print earlyStart+31
2005/11/01
Invalid behavior: (Here's the problem)
>>> from DateTime import DateTime
>>> start=DateTime(
>>> print start
2005/10/01 01:00:00 US/Central
>>> earlyStart=
>>> 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.
affects: | zope2 → datetime |
Changed in datetime: | |
status: | New → Confirmed |
The datetime project on Launchpad has been archived at the request of the Zope developers (see https:/ /answers. launchpad. net/launchpad/ +question/ 683589 and https:/ /answers. launchpad. net/launchpad/ +question/ 685285). If this bug is still relevant, please refile it at https:/ /github. com/zopefoundat ion/datetime.