forked from josch/img2pdf
Treat default creation/mod dates as UTC (fixes #155)
(Tested with Python 3.11.3 on Arch Linux.) Without passing a tzinfo object to `datetime.now()`, a "naive" datetime object is created, which is not timezone-aware. To fix the default date/time detection for non-UTC local timezones, pass `datetime.timezone.utc` to convert the value to UTC and make the datetime object "aware". Also, adjust the strftime() wrappers to use the UTC offsets instead of a literal `Z`; using the literal `Z` at the end appears to be valid for ISO 8601, but for some reason it does not successfully convert, whereas the `%z` placeholder substitutes the UTC offset and successfully converts.pdf-xmp-timestamps
parent
7fa67bb337
commit
1dd05cc36b
Loading…
Reference in New Issue