From 73c5032a4803a4fdf87d58c68b9cdcb5535682ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 14 Jun 2017 12:06:04 +0200 Subject: [PATCH] Convert timezone, not replace it --- pillar/api/blender_id.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillar/api/blender_id.py b/pillar/api/blender_id.py index ba5bac9d..61970621 100644 --- a/pillar/api/blender_id.py +++ b/pillar/api/blender_id.py @@ -205,7 +205,7 @@ def _compute_token_expiry(token_expires_string): from dateutil import parser blid_expiry = parser.parse(token_expires_string) - blid_expiry = blid_expiry.replace(tzinfo=tz_util.utc) + blid_expiry = blid_expiry.astimezone(tz_util.utc) our_expiry = datetime.datetime.now(tz=tz_util.utc) + datetime.timedelta(hours=1) return min(blid_expiry, our_expiry)