aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shirayuki Nekomata <[email protected]>2019-11-27 14:39:18 +0700
committerGravatar Shirayuki Nekomata <[email protected]>2019-11-27 14:39:18 +0700
commit4ee01649786edcd9b0bbb88d55f1672953afc6fe (patch)
treecaa4cbdd917ba4f033be167b4cb79bba6ab748e2
parentImplemented `get_duration_from_expiry()` which call `get_duration()` for `exp... (diff)
Fixed TypeError raised by substracting offset-naive and offset-aware datetimes ( removed tzinfo from expiry )
-rw-r--r--bot/utils/time.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/utils/time.py b/bot/utils/time.py
index 00f39b940..fc003f9e2 100644
--- a/bot/utils/time.py
+++ b/bot/utils/time.py
@@ -161,5 +161,5 @@ def get_duration_from_expiry(expiry: str) -> str:
:param expiry: A string.
"""
date_from = datetime.datetime.utcnow()
- date_to = dateutil.parser.isoparse(expiry)
+ date_to = dateutil.parser.isoparse(expiry).replace(tzinfo=None)
return get_duration(date_from, date_to)