Jump to content

Modified time takes server timezone, even though I've set my local timezone

Recommended Posts

Perhaps I've done this wrong, but modified times across the board are always an hour ahead because my server is set to UTC-5 but I'm in the UTC-6 timezone.

I have set the timezone to America/Chicago in the site config. All clocks and set to NTP sync, but I still get warnings that someone started editing a page 60 minutes from now.

Any other thoughts on what I may need to check?

Link to comment
Share on other sites

It looks like this may be connected to a glitch in calculations for timestamps that account for daylight savings time.

It looks like if you are in a timezone with daylight savings the UTC timestamp is advanced 60 minutes before it gets saved in the field. I have created an issue for it in github.

Just explain further for the curious, I have a template with the following code:

<p>Now: <?=( time() )?> Edited: <?=( $page->modified )?></p>

And when I edit the page and save it, the output I get is this:


CST (Central Standard Time) is -0600, but CDT (which we're currently in) is -0500 and if I expand the formatting to include the timezone name it is CDT - so the timezone is correct, it's just the extra calculation of the timestamp that is unnecessary - the field should preserve the timestamp as-is and let the session timezone dictate the offset.

The time in the example should be 12:16:14 PM.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...