Show More
@@ -1,5 +1,6 b'' | |||
|
1 | 1 | import feedparser |
|
2 | 2 | import logging |
|
3 | import calendar | |
|
3 | 4 | |
|
4 | 5 | from time import mktime |
|
5 | 6 | from datetime import datetime |
@@ -51,7 +52,7 b' class ThreadSource(models.Model):' | |||
|
51 | 52 | items = sorted(feed.entries, key=lambda entry: entry.published_parsed) |
|
52 | 53 | for item in items: |
|
53 | 54 | title = item.title[:TITLE_MAX_LENGTH] |
|
54 |
timestamp = datetime.fromtimestamp( |
|
|
55 | timestamp = datetime.fromtimestamp(calendar.timegm(item.published_parsed), tz=utc) | |
|
55 | 56 | if not timestamp: |
|
56 | 57 | logger.error('Invalid timestamp {} for {}'.format(item.published, title)) |
|
57 | 58 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now