Can't parse a 1904 date in ARPA format (email date)
Posted
by Ramon
on Stack Overflow
See other posts from Stack Overflow
or by Ramon
Published on 2010-04-15T21:09:25Z
Indexed on
2010/04/15
21:13 UTC
Read the original article
Hit count: 393
I'm processing an IMAP mailbox and running into trouble parsing the dates using the mxDateTime package. In particular, early dates like "Fri, 1 Jan 1904 00:43:25 -0400" is causing trouble:
>>> import mx.DateTime
>>> import mx.DateTime.ARPA
>>> mx.DateTime.ARPA.ParseDateTimeUTC("Fri, 1 Jan 1904 00:43:25 -0400").gmtoffset()
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
Error: cannot convert value to a time value
>>> mx.DateTime.ARPA.ParseDateTimeUTC("Thu, 1 Jan 2009 00:43:25 -0400").gmtoffset()
<mx.DateTime.DateTimeDelta object for '-08:00:00.00' at 1497b60>
>>>
Note that an almost identical date from 2009 works fine. I can't find any description of date limitations in mxDateTime itself. Any ideas why this might be?
Thx,
Ramon
© Stack Overflow or respective owner