Convert creation/modification dates to UTC (fixes #155) #168
Loading…
Reference in a new issue
No description provided.
Delete branch "phmccarty/img2pdf:utc-timestamps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
(Tested with Python 3.11.3 on Arch Linux.)
Ensure that timezones are correctly interpreted in the input by calling
.astimezone()
as appropriate on datetime objects, and store theresulting date fields as UTC.
One could argue that datetimes in the local timezone be stored in the
PDF, but then the date string handling becomes more complicated; the PDF
and XMP date specs both use the
Z
suffix to indicate UTC time, butother +/- offsets require different syntax between the two specs.
After doing a bit more research, I discovered that PDF and XMP have different syntax for timezone offsets... I pushed an experimental change to another branch (atop this branch): https://gitlab.mister-muffin.de/phmccarty/img2pdf/commits/branch/pdf-xmp-timestamps
Updated the MR to reflect the discussion from #155
85efd9a80a
to512478ac4e
Treat default creation/mod dates as UTC (fixes #155)to Convert creation/modification dates to UTC (fixes #155)512478ac4e
to81502f21af
One more update: I squashed changes into one commit to minimize the churn between commits.