Skip to content

Commit

Permalink
Need to use replace for naive timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
jrods committed Sep 13, 2016
1 parent b6d51cb commit 596f5fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/lib/formatters.py
Expand Up @@ -101,7 +101,7 @@ def months_between(date1, date2):
if not show_date:
now = datetime.datetime.now(pytz.utc)
if datetime_.tzinfo is None:
datetime_ = datetime_.astimezone(pytz.utc)
datetime_ = datetime_.replace(tzinfo=pytz.utc)

date_diff = now - datetime_
days = date_diff.days
Expand Down

0 comments on commit 596f5fd

Please sign in to comment.