ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Another Timezone Localization Thread...

February 17, 2012 12:26pm

Subscribe [1]
  • #1 / Feb 17, 2012 12:26pm

    Noah Kuhn

    60 posts

    MediaTemple Grid Service hosting. Physical host is in California (PST)

    EE 2.3.1, and EE 2.4.0 both have the same behavior.

    command line “date” command returns: Fri Feb 17 09:20:00 PST 2012
    php.ini config has this set: date.timezone=“US/Pacific”

    Admin > Localization Settings
    Server Time Zone: (UTC -8:00) Pacific Standard Time, Clipperton Island
    Server Offset: blank
    Default Time Formatting: United States
    Daylight Savings Time: No

    Members > Preferences
    Allow members to set their own localization preferences: No

    When I go to create a new entry, the entry date is one hour ahead of the current time. For example I am on the east coast where it is 12:20 PM, the Entry Date field shows as 01:20 PM. If I click into the Entry Date field and click the current date (2/17), the date gets updated to the current time (12:20 PM).

    Turning on the member localization preferences option and selecting (UTC -5:00) seems to set things appropriately, but why are things off by an hour with the localization prefs off?

    I know this type of question is asked quite often. Seems something is just not as intuitive as it should be. I guess my expectation is that the dates would be related to whatever the current Server Time Zone setting is. (Entry Date would be NOW in PST, or (9:20 am in the above example)

  • #2 / Feb 18, 2012 1:52pm

    Dan Decker

    7338 posts

    Hi Noah Kuhn,

    I was able to replicate your experience. Using my own local server, I adjusted both the timezone setting on the server and the timezone setting on my Mac. In my tests, the time was off by an hour in the other direction, but just as you describe, clicking the date forced it to update to the accurate time.

    I can’t explain the offset other than the server is using PHP to set the time, and the browser is using JavaScript based on your machine’s time. It doesn’t explain why the time is off in the first place.

    It is important that even when allowing members to set their own localization preferences is disabled, that you set it properly for each member.

    I’ll bring this up with the developers to get some clarification.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases