Skip to content

Commit

Permalink
[#2494] Only set UTC if datetime has no timezone info yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Oderbolz committed Jul 9, 2015
1 parent 5d3f42d commit 7d1d391
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/lib/formatters.py
Expand Up @@ -133,7 +133,7 @@ def months_between(date1, date2):
return ungettext('over {years} year ago', 'over {years} years ago',
months / 12).format(years=months / 12)

if datetime_.tzinfo is not None:
if datetime_.tzinfo is None:
datetime_ = datetime_.replace(tzinfo=pytz.utc)

# actual date
Expand Down

0 comments on commit 7d1d391

Please sign in to comment.