DateTime trouble parsing daylight savings time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DateTime |
Invalid
|
Medium
|
Unassigned |
Bug Description
DateTime is raising a SyntaxError when encountering datetime strings that have daylight savings time zones such as EDT, CDT, MDT, PDT. This can be tested as follows:
[pts6][zope@horus DateTime]$ python
Python 2.4.3 (#1, Jun 14 2006, 14:53:31)
[GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from DateTime import DateTime
>>> dt = DateTime('Wed, 14 Mar 2007 09:44:06 EDT')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/
return self._parse_
File "/usr/lib/
yr,
File "/usr/lib/
raise SyntaxError, st
DateTime.
>>> dt = DateTime('Wed, 14 Mar 2007 09:44:06 EST')
>>> print dt.timezone()
US/Eastern
>>> dt = DateTime('Wed, 14 Mar 2007 09:44:06 CDT')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/
return self._parse_
File "/usr/lib/
yr,
File "/usr/lib/
raise SyntaxError, st
DateTime.
>>> dt = DateTime('Wed, 14 Mar 2007 09:44:06 CST')
>>> print dt.timezone()
US/Central
The results are the same for Mountain and pacific time as well.
I have not yet found a fix for this problem. I discovered it using PloneFeedFeeder when trying to parse a news feed with the datetime stamp used in this example.
affects: | zope2 → datetime |
Changes: submitter email, importance (critical => medium), new comment
This is not critical