Correctly parsing an ATOM feed

Posted by Joseph on Stack Overflow See other posts from Stack Overflow or by Joseph
Published on 2010-05-05T01:05:12Z Indexed on 2010/05/05 1:08 UTC
Read the original article Hit count: 300

Filed under:
|
|

I currently have setup a Python script that uses feedparser to read a feed and parse it. However, I have recently come across a problem with the date parsing. The feed I am reading contains <modified>2010-05-05T24:17:54Z</modified> - which comes up in Python as a datetime object - 2010-05-06 00:17:54. Notice the discrepancy: the feed entry was modified on the 5th of may, while python reads it as the 6th.

So the question is why this is happening. Is the ATOM feed (that is, the one who created the feed) wrong by putting the time as 24:17:54, or is my python script wrong in the way it treats it.

And can I solve this?

© Stack Overflow or respective owner

Related posts about atom

Related posts about python