Remove colons from date string so Python 3.5 can parse

This commit is contained in:
Tanner Collin 2020-12-15 23:19:50 +00:00
parent c9fb9bd5df
commit 3ff917e806

View File

@ -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 = {}