Feedparser and dates
fredrik at pythonware.com
Wed Mar 15 14:36:39 CET 2006
> I'm using FeedParser.org to import feeds into our MySQL database.
> Our problem is that we haven't found a solution to translate the date
> of a post item into GMT.
from what I can tell, feedparser returns a 9-item UTC time tuple (which
is the same thing as GMT, at least for all practical purposes).
if it's a standard timestamp you want, you can use calendar.timegm:
>>> t = (2004, 1, 1, 19, 48, 21, 3, 1, 0)
>>> import calendar
>>> import time, datetime
'Thu Jan 01 19:48:21 2004'
datetime.datetime(2004, 1, 1, 19, 48, 21)
More information about the Python-list