diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py index af29c4b5..389d97fe 100644 --- a/gallery_dl/extractor/pixiv.py +++ b/gallery_dl/extractor/pixiv.py @@ -42,7 +42,7 @@ class PixivExtractor(Extractor): del work["meta_pages"] work["num"] = "" work["tags"] = [tag["name"] for tag in work["tags"]] - work["date"] = text.parse_datetime(work["create_date"]) + work["date"] = text.parse_datetime(work["create_date"][:-3] + "00") work.update(metadata) yield Message.Directory, work diff --git a/test/test_text.py b/test/test_text.py index 037359de..b0b077e2 100644 --- a/test/test_text.py +++ b/test/test_text.py @@ -353,11 +353,11 @@ class TestText(unittest.TestCase): def test_parse_datetime(self, f=text.parse_datetime): null = datetime.datetime.utcfromtimestamp(0) - self.assertEqual(f("1970-01-01T00:00:00+00:00"), null) - self.assertEqual(f("1970.01.01", "%Y.%m.%d") , null) + self.assertEqual(f("1970-01-01T00:00:00+0000"), null) + self.assertEqual(f("1970.01.01", "%Y.%m.%d") , null) self.assertEqual( - f("2019-05-07T21:25:02+09:00"), + f("2019-05-07T21:25:02+0900"), datetime.datetime(2019, 5, 7, 12, 25, 2), )