From 7b61b5b02d2f62f9c6c8a29e8f483aa0225917f6 Mon Sep 17 00:00:00 2001 From: CMDR furrycat Date: Thu, 13 Apr 2017 17:02:42 +0100 Subject: [PATCH] Use proper UTZ datetime. --- bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 25dfa75..e59e2ff 100644 --- a/bot.py +++ b/bot.py @@ -1,4 +1,5 @@ import asyncio +import calendar import datetime import discord import hashlib @@ -669,7 +670,7 @@ def iso8601(timestamp): return datetime.datetime.utcfromtimestamp(timestamp).isoformat()[:19] + 'Z' def parse_iso8601(string): - return int(datetime.datetime.strptime(string, '%Y-%m-%dT%H:%M:%SZ').timestamp()) + return calendar.timegm(datetime.datetime.strptime(string, '%Y-%m-%dT%H:%M:%SZ').utctimetuple()) def ago(timestamp): now = int(time.time()) -- 2.7.4