diff --git a/atom/blog.xml b/atom/blog.xml index 547b821..1718d5d 100644 --- a/atom/blog.xml +++ b/atom/blog.xml @@ -8,7 +8,7 @@ baruchel@sdf.org CC BY-SA 4.0 - 2022-11-05T15:32:51 + 2022-11-05T14:38:33+00:00Z rst2atom @@ -16,7 +16,7 @@ Initial entry urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a - 2022-11-05T00:00:00 + 2022-11-05T00:00:00Z

Initial entry

diff --git a/rst2atom.py b/rst2atom.py index 8342c13..b8711cc 100644 --- a/rst2atom.py +++ b/rst2atom.py @@ -43,7 +43,7 @@ def extract_meta(html): def find_date(d): """ - Parse the comments in a
section and return a an ISO8601 formatted + Parse the comments in a
section and return a an RFC 3339 formatted string being the first recognized date string. Raise dateutil.parser.ParserError if no such comment contains a date. @@ -60,7 +60,7 @@ def find_date(d): for k in c.extract().split(" "): try: t = dateutil.parser.parse(k) - return t.isoformat(timespec='seconds') + return t.isoformat(timespec='seconds') + "Z" except dateutil.parser.ParserError: pass raise dateutil.parser.ParserError @@ -118,7 +118,7 @@ print(""" docinfos["Author:"], docinfos["Contact:"], meta["copyright"], - datetime.datetime.now().isoformat(timespec='seconds'), + datetime.datetime.now(datetime.timezone.utc).isoformat(timespec='seconds') + "Z", meta["original-source"], meta["syndication-source"], generator_uri, generator_name