in reply to Server Time

However, I have a bit of test code left in a page that only I use. It's a bit of JavaScript document.write(document.lastModified); which shows the time in BST. Doen't that time get passed in the HTTP headers from the Perl generated web page?

Nope, Javascript runs on the client side, not the server. The timezone there will be the timezone of your browser/WM/DE/OS on the local machine.

Are there any reasons not to change the server to GMT bearing in mind that the entire codebase was written on a server that observes DST?

The reason is that this will have no observable effect. For most practical purposes GMT and UTC are the same. Neither has anything to do with daylight savings adjustments.

the "obvious" option to set would be 'Europe/London' but that is not included in timedatectl list-timezones

Yes, that would be ideal. You will need to convince your OS that such a zone exists. Since you haven't mentioned the distro it's hard to give any further detailed advice at this stage.

None of this is specific to Perl, BTW. You might consider making your application code independent of the O/S timezone - then this problem just vanishes.


🦛

Replies are listed 'Best First'.
Re^2: Server Time [OT]
by Bod (Parson) on Apr 07, 2024 at 20:18 UTC
    You will need to convince your OS that such a zone exists

    Thank you hippo - that was the nugget of information I needed to solve the problem 😊

Re^2: Server Time [OT]
by Bod (Parson) on Apr 07, 2024 at 17:36 UTC
    Since you haven't mentioned the distro it's hard to give any further detailed advice at this stage.

    It's Debian 12 with Plesk Obsidian installed.

    I had in my head that the client side time was generated by a Perl Template but when I checked, it was actually Javascript.