Skip to content

Commit

Permalink
timezone errors.
Browse files Browse the repository at this point in the history
git-svn-id: https://jerakeen.org/svn/tomi/Projects/Shelf@3859 ab05c693-d3d1-0310-8e8b-e1346d90d6a5
  • Loading branch information
tomi committed Mar 10, 2008
1 parent 733688c commit 8822e8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Utilities.py
Expand Up @@ -150,7 +150,7 @@ def time_ago_in_words(from_time, include_seconds=False):
"""
Like distance_of_time_in_words, but where ``to_time`` is fixed to ``datetime.now()``.
"""
ago = distance_of_time_in_words(from_time, datetime.now(), include_seconds)
ago = distance_of_time_in_words(from_time, datetime.utcnow(), include_seconds)
# TODO - think about these. The output from the function is Too Damn Long, is all.
ago = re.sub(r'^about ', '~', ago )
ago = re.sub(r'minute', 'min', ago )
Expand Down
2 changes: 2 additions & 0 deletions providers/FeedProvider.py
Expand Up @@ -123,12 +123,14 @@ def htmlForFeed( self, url, feed, stale = False ):
for item in filter( lambda item: "link" in item, entries )[0:4]:
if 'published_parsed' in item: date = item.published_parsed
elif 'updated_parsed' in item: date = item.updated_parsed
else: date = None

if date:
#html += u'<span class="feed-date">%s</span>'%( time.strftime("%b %d", date ) )
ago = time_ago_in_words(date) + " ago"
html += u'<span class="feed-date">%s</span>'%ago
title = 'title' in item and item.title or "untitled"

try:
html += u'<p class="feed-title"><a href="%s">%s</a></p>'%( item.link, title )
except UnicodeDecodeError:
Expand Down

0 comments on commit 8822e8f

Please sign in to comment.