Simple RSS Reader inspired by Gxxgle Reader
Revision | 7dd650fe3d04a7b893178bb0031c304bcac49793 (tree) |
---|---|
Time | 2013-07-16 19:34:13 |
Author | hylom <hylom@hylo...> |
Commiter | hylom |
backend: convert feed's timestamp to UTC
@@ -36,10 +36,14 @@ class FeedFetcher(object): | ||
36 | 36 | # if date is not defined, item is invalid |
37 | 37 | continue |
38 | 38 | |
39 | + # parse timestamp and convert UTC | |
39 | 40 | entry.timestamp = dateutil.parser.parse(entry.timestamp) |
40 | 41 | if entry.timestamp.tzinfo == None: |
41 | 42 | entry.timestamp = entry.timestamp.replace(tzinfo=dateutil.tz.tzutc()) |
42 | 43 | |
44 | + else if entry.timestamp.tzinfo != dateutil.tz.tzutc(): | |
45 | + entry.timestamp = entry.timestamp.astimezone(dateutil.tz.tzutc()) | |
46 | + | |
43 | 47 | entries.append(entry) |
44 | 48 | return entries |
45 | 49 |