timezone stripping
This commit is contained in:
parent
f586eaa8cb
commit
5ad4d84a97
1 changed files with 2 additions and 1 deletions
3
ago.py
3
ago.py
|
|
@ -17,7 +17,8 @@ def human(dt, precision=2, past_tense='{} ago', future_tense='in {}', abbreviate
|
|||
"""Accept a datetime or timedelta, return a human readable delta string"""
|
||||
delta = dt
|
||||
if type(dt) is not type(timedelta()):
|
||||
delta = datetime.now() - dt
|
||||
dt_no_tz = dt.replace(tzinfo=None)
|
||||
delta = datetime.now() - dt_no_tz
|
||||
|
||||
the_tense = past_tense
|
||||
if delta < timedelta(0):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue