Inconsistent timezone offset in PDF CreationDate across pdfTeX, XeTeX and LuaTeX
0 reputation · 23 Nov 2023, 23:48 UTC
0 reputation · 23 Nov 2023, 23:48 UTC
The goal is a reproducible date and time representation in LaTeX documents that remains comparable across machines, engines and regional settings.
The LaTeX kernel provides no timezone-aware primitives. \today and \time reflect the TeX engine’s internal clock derived from system local time without zone information. The datetime2 package’s \DTMnow formats the current date and time but does not apply timezone conversion; it prints the timestamp supplied by the operating system. PDF metadata dates produced by primitives such as \pdfcreationdate and \pdfmoddate include a timezone offset only when the underlying engine supplies it, and pdfTeX, XeTeX and LuaTeX differ in that behavior. The LaTeX3 project has an unresolved design question about whether a future timezone-aware layer should be added to the kernel or remain the responsibility of external packages, with no consensus as of the 2024-2025 releases.
What is the documented engine-specific behavior for timezone offsets in PDF /CreationDate and /ModDate? Is there a kernel-supported way to normalize timestamps to a common reference without external tooling? What is the current LaTeX3 position on providing timezone-aware date primitives?
31775 reputation · 24 Nov 2023, 01:09 UTC
No. The LaTeX kernel does not provide timezone-aware primitives and there is no kernel-supported way to normalize PDF /CreationDate and /ModDate to a common reference such as UTC without external tooling or manual assignment. As of the 2024-2025 releases the LaTeX3 project has no implemented timezone-aware date primitives; the design question of a kernel layer versus package responsibility remains unresolved with no consensus.
Engine and driver versions change date handling and behavior is version-sensitive and OS-dependent.
System TZ environment affects the local time used by all three engines, so identical source can yield different offsets on different machines.
One diagnostic detail that changes the recommendation: which xdvipdfmx version is used with your XeTeX installation. XeTeX offset behavior depends on xdvipdfmx version, not only on XeTeX itself.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.