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 authored and amercader committed Feb 28, 2018
1 parent 3fc58a1 commit 99ea1fe
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 99ea1fe

Please sign in to comment.