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.

EE Miscalculates Dates & DST

September 07, 2012 2:04pm

Subscribe [2]
  • #1 / Sep 07, 2012 2:04pm

    DaveHamilton

    22 posts

    I’m submitting this as a bug, too, but was advised to do both, so… here we are in the forums.

    In CP, my Admin > Localization Settings are set to

              Server Time Zone = UTC -5:00 Eastern Standard Time
              Daylight Saving Time = Yes

    My personal user account’s Localization Settings are set the same:

              Time Zone UTC -5
              DST checked/yes

    So I wrote a simple one-line script to test:

              Date = {current_time format="{DATE_RSS} %T”}

    I added the %T for a reason that I’ll explain.

    When I’m logged in, I get:

              Date = Fri, 07 Sep 2012 14:00:02 -0400 EDT

                  ^^ That is correct

    When I’m not logged in, and the system is using its own localization, I get:

              Date = Fri, 07 Sep 2012 13:00:07 -0400 EST

                            ^^ Note how the system has reduced the time by one hour. This is bad because *it’s the wrong time*. The time is 14:00 -0400 or 13:00 -0500, but it’s not 13:00 - 0400. See what I mean? Bug. Bad bug.

    But here’s the thing… in Admin > Localization settings you have but one option about time zone: “Server Time Zone”—and the thing is, our server is smart enough (like most servers are) to account automatically for DST. So right now our server is on UTC -4:00 because we’re in Eastern Time and on DST. But I have it set to UTC -5:00 with DST set to “Yes” because that *seems* appropriate. But if I set it to uTC-4:00 then EE gets it right…

    Except displaying the time zone NEVER shows a “D”—it either shows EST or AST, but it’s not smart enough to show the “D”... unless I’m logged in and then it shows EDT just fine.

    See how messed up this is?

    Edit: This is also in Bug Tracker as Bug ID 18220

  • #2 / Sep 07, 2012 2:31pm

    Adam Christianson

    115 posts

    Just adding a mention to a work around that we ended up implementing on our site so that we could force a consistent time on entries. We created a plug-in to take the {gmt_entry_date} and convert it to a specified timezone. In our case we always want our entry times to display in EDT/EST so we can take the GMT entry date and use the add on to convert and return a date formatted for that timezone.

    Our BBM GMT to Local plug-in is here on GitHub if anyone should find it handy.
    https://github.com/phylaxis/BBM-gmt-to-local

  • #3 / Sep 10, 2012 12:14pm

    Dan Decker

    7338 posts

    Hey Dave,

    Thank you for reporting here and in the Bug Report.

    I’ve confirmed, to a degree. I’m in Central UTC-6 and the time and DST display properly, but the timezone still shows as -0400!
    Logged out-

    Date = Mon, 10 Sep 2012 11:01:37 -0400 CDT

    Logged in-

    Date = Mon, 10 Sep 2012 11:01:25 -0400 CDT

    So, part of the issue seems confined to the East. I had another CAT check in PDT and same result.

    I’ll post this reply in the bug report so the Engineers have that info to work with to.

    I do apologize for the inconvenience!

    Adam,
    Thanks for sharing the plugin!

    Cheers,

     

  • #4 / Sep 10, 2012 3:35pm

    DaveHamilton

    22 posts

    Thanks, Dan. Out of curiosity, Dan, what operating system and time zone is your server on? Just curious since that will make a difference, of course. We’re on Gentoo linux and /etc/localtime points to /usr/share/zoneinfo/America/New_York

    -Dave

  • #5 / Sep 11, 2012 12:11pm

    Dan Decker

    7338 posts

    Hey Dave,

    My sandbox is on a local Mac OS X Server machine dedicated to ExpressionEngine and other hacking. Shane also tested in PDT on a linux box (CentOS I believe…)

    Cheers,

  • #6 / Sep 20, 2012 1:00pm

    DaveHamilton

    22 posts

    How’s this coming along? Is this a fix we can expect soon? Dates, and especially DST have been a persistent issue with EE since we started using it 3 or 4 years ago. This bug exacerbates the problem, and we really need to get it fixed, not just for us, but for everyone running EE, I’m sure.

  • #7 / Sep 24, 2012 11:09am

    Dan Decker

    7338 posts

    Hi Dave,

    You can expect follow-ups in the Bug Report. I do know the Engineers had a long discussion regarding ExpressionEngine and date/time handling last week.

    Due to the nature of date/time issues and the impact it can have, the fix will most likely be part of a future release.

    Cheers,

  • #8 / Sep 24, 2012 11:15am

    DaveHamilton

    22 posts

    Thanks, Dan. Here’s to hoping that future release comes out soon. This problem almost had us revert back to 1.x—it was still broken there, of course, but in a different way. The devil we knew… 😉

  • #9 / Sep 25, 2012 9:10am

    Dan Decker

    7338 posts

    Hi Dave,

    Keep an eye on the change log 😉

    Is there anything else I can assist you with?

    Cheers,

  • #10 / Sep 25, 2012 9:14am

    DaveHamilton

    22 posts

    Thanks, Dan. Will keep my eyes peeled!

  • #11 / Sep 26, 2012 10:26am

    Dan Decker

    7338 posts

    Excellent!

    If you Gents need anything else, please let us know in a new thread.

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases