diff options
author | 2019-11-27 14:39:18 +0700 | |
---|---|---|
committer | 2019-11-27 14:39:18 +0700 | |
commit | 4ee01649786edcd9b0bbb88d55f1672953afc6fe (patch) | |
tree | caa4cbdd917ba4f033be167b4cb79bba6ab748e2 | |
parent | Implemented `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.py | 2 |
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) |