Time stamp is off

Stephan Witt st.witt at gmx.net
Wed Jun 21 05:31:06 UTC 2023


Am 19.06.2023 um 21:30 schrieb R. H. van der Gaag <rhvandergaag at gmail.com>:
> 
> On 19 Jun 2023, at 18:46, Richard Kimberly Heck <rikiheck at gmail.com> wrote:
>> 
>> On 6/19/23 09:36, R. H. van der Gaag wrote:
>>> 
>>> Thanks for checking. Insert date gives the correct (Dutch) time here, too. But the time stamps added to the LaTeX preview are always exactly two hours behind. A riddle.
>> 
>> Two hours behind sounds like UCT (GMT). European time is one hour ahead but then another hour for daylight savings. I suspect that your system clock is set for UCT, which is what LaTeX is picking up.
>> 
>> I've had similar problems on a Windows system.
> 
> My macOS preferences say "Central European Summer Time" and in the terminal I get
> 
> rh at iMac ~ % date
> Mon Jun 19 21:27:10 CEST 2023
> 
> It remains a mystery, then, where LyX or LaTeX gets its UCT/GMT time from. Should I worry about this possibly messing up sync?

Which sync you’re referring to?

I’ve read the code for change tracking in LyX and IMO its as follows:
1. LyX saves the timestamp to the document file as Unix timestamp. No timezone involved. (*)
2. LyX converts this timestamp to string presentation via gmtime(3) and asctime(3). No timezone involved again.

IMO there is no sync problem in LyX documents. The saved timestamp is always w/o timezone. The timestamps in LaTeX export file should be interpreted as UTC.

(*) Others problems are implied:
1. Unix time_t doesn’t consider leap seconds.
2. On 32-bit systems the time ends on January 19, 2038.

Stephan


More information about the lyx-users mailing list