Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use UTC date/time for PS/PDF file metadata #490

Closed
havardAasen opened this issue May 21, 2022 · 5 comments
Closed

Use UTC date/time for PS/PDF file metadata #490

havardAasen opened this issue May 21, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request priority-low
Milestone

Comments

@havardAasen
Copy link
Contributor

After the change from gmtime_r to localtime_r in a67e9cc, the build became unreproducible. Where it's the timezone that makes the difference. This is in part a regression from #310.

When we build this package in Debian, we create the documentation at the same time, with HTMLDOC. This means that with version 1.9.16, the CreationDate of pdf and ps documents, will change depending on timezone.

How important is the need to use localtime_r? I noticed #485, which makes me believe this is a wanted feature.
Also, was the change to localtime_r needed for #472 to be fully functional?

@michaelrsweet
Copy link
Owner

@havardAasen I'll look at this when I get a chance, but I believe the issue is that I only have the one doc_date value cached when generating a PS or PDF file. Using a separate UTC value is a possibility...

@michaelrsweet michaelrsweet self-assigned this May 22, 2022
@michaelrsweet michaelrsweet added enhancement New feature or request priority-low labels May 22, 2022
@michaelrsweet michaelrsweet added this to the Stable milestone May 22, 2022
@michaelrsweet michaelrsweet changed the title Unreproducible build Use UTC date/time for PS/PDF file metadata May 22, 2022
@michaelrsweet
Copy link
Owner

I will note, however, that any document that is generated with a date or time in the header or footer will still end up using the local timezone. Shouldn't be an issue for the HTMLDOC users manual but my proposed fix won't solve your issue with HTMLDOC as a build tool. There you should probably force the timezone setting in the environment (probably to UTC).

@havardAasen
Copy link
Contributor Author

@michaelrsweet, reading you previous comment, it seems you have a solution in mind?

The only thing I can think of is in the direction of a command-line argument like --utc, and then just toggle localtime_r and gmtime_r. If not entirely elegant, it's at least simple.

@michaelrsweet
Copy link
Owner

@havardAasen Yes, set the "TZ" environment variable to "UTC" or "GMT" to get dates and times in UTC. Like I said, this will affect the dates and times in headers/footers as well.

@michaelrsweet
Copy link
Owner

[master 8d16a96] Use UTC for PS/PDF metadata (Issue #490)

Changes only affect the metadata. If you put date/time information in the header/footer then you need to set the timezone prior to running htmldoc in order to force UTC vs. local time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-low
Projects
None yet
Development

No branches or pull requests

2 participants