From 78bc52abf290c5107a663373b350e29c3964cc3f Mon Sep 17 00:00:00 2001 From: t-mw Date: Sat, 18 May 2019 22:32:09 +0200 Subject: [PATCH] Fix json export date parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The format string for `datetime.strptime` did not match the example line in the comment below, since `%z` matches ["UTC offset in the form ±HHMM"](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior). --- archivebox/parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebox/parse.py b/archivebox/parse.py index baaa447e..edd497a6 100644 --- a/archivebox/parse.py +++ b/archivebox/parse.py @@ -103,7 +103,7 @@ def parse_json_export(json_file): json_file.seek(0) links = json.load(json_file) - json_date = lambda s: datetime.strptime(s, '%Y-%m-%dT%H:%M:%S%z') + json_date = lambda s: datetime.strptime(s, '%Y-%m-%dT%H:%M:%SZ') for link in links: # example line