• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Simple RSS Reader inspired by Gxxgle Reader


Commit MetaInfo

Revision7dd650fe3d04a7b893178bb0031c304bcac49793 (tree)
Time2013-07-16 19:34:13
Authorhylom <hylom@hylo...>
Commiterhylom

Log Message

backend: convert feed's timestamp to UTC

Change Summary

Incremental Difference

--- a/backend/fetcher/feed.py
+++ b/backend/fetcher/feed.py
@@ -36,10 +36,14 @@ class FeedFetcher(object):
3636 # if date is not defined, item is invalid
3737 continue
3838
39+ # parse timestamp and convert UTC
3940 entry.timestamp = dateutil.parser.parse(entry.timestamp)
4041 if entry.timestamp.tzinfo == None:
4142 entry.timestamp = entry.timestamp.replace(tzinfo=dateutil.tz.tzutc())
4243
44+ else if entry.timestamp.tzinfo != dateutil.tz.tzutc():
45+ entry.timestamp = entry.timestamp.astimezone(dateutil.tz.tzutc())
46+
4347 entries.append(entry)
4448 return entries
4549