From 3ff917e80643cadea2c9daf96a00dbe86b9ac694 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Tue, 15 Dec 2020 23:19:50 +0000 Subject: [PATCH] Remove colons from date string so Python 3.5 can parse --- apiserver/feeds/lobsters.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apiserver/feeds/lobsters.py b/apiserver/feeds/lobsters.py index c3fea2e..98d991f 100644 --- a/apiserver/feeds/lobsters.py +++ b/apiserver/feeds/lobsters.py @@ -44,7 +44,8 @@ def feed(): return [x['short_id'] for x in api(API_HOTTEST) or []] def unix(date_str): - return int(datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%S.%f%z').timestamp()) + date_str = date_str.replace(':', '') + return int(datetime.strptime(date_str, '%Y-%m-%dT%H%M%S.%f%z').timestamp()) def make_comment(i): c = {}