[egenix-users] DateTimeFrom parser error
Edwin Grubbs
egrubbs at rackspace.com
Thu Feb 19 12:10:39 CET 2004
I get parse error when parsing a date in this format when the hour is
"12".
>>> from mx.DateTime import DateTimeFrom
>>> DateTimeFrom('Thursday, February 19, 2004 12:05:34 PM CST')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/site-packages/mx/DateTime/DateTime.py", line 219, in DateTimeFrom
return Parser.DateTimeFromString(arg)
File "/usr/lib/python2.2/site-packages/mx/DateTime/Parser.py", line 567, in DateTimeFromString
raise DateTime.RangeError,\
mx.DateTime.RangeError: Failed to parse "Thursday, February 19, 2004 12:05:34 PM CST": hour out of range (0-23): 24
>>>
But parsing 11 o'clock works fine:
>>> DateTimeFrom('Thursday, February 19, 2004 11:05:34 PM CST')
<DateTime object for '2004-02-20 05:05:34.00' at 81bd228>
>>>
-Edwin
More information about the egenix-users
mailing list