skip to content

ExpressionEngine Times, Localization, and Entry Dates

November 05th, 2007

I had originally wrote this as a response to a support request, and then wrote it up in the ExpressionEngine Knowledge Base as Times, Localization, and Entry Dates, but given the transition out of Daylight Savings Time (DST) this weekend, I wanted to repost it here.

One of the hardest areas of web applications to get your head around is the treatment of dates across various timezones, servers, and computers with daylight savings time (DST).  There are so many variables that ExpressionEngine can never be 100% sure of the proper time, and often the only answer is to experiment.  The wiki article Dates Explained may help in this.

Here’s the problem with time.  Imagine you and your buddies are trying to meet up at a set time, and you’ve all given me your watches so I can phone you at exactly 7 to tell you to be there.  When I get your watches, some of them are set 1 hour behind everyone elses (DST).  OK, confusing, but as long as I know that are observing DST I can account for this.  Now imagine that each one is set for a different time zone.  OK, also confusing, but I can figure that out also.  Now suddenly some of the watches stop observing DST (many hosts do), or start observing at different times.  Now I’m scratching my head.  I get a bunch of new watches, and I don’t know if they are observing DST or not.  Now some of the watches are simply set to the wrong time.  There’s also a master watch with the official time used for each day you want to meet your friends, and every day there’s a new way of officially adding and removing that hour.

Here’s how I have my system setup to give me accurate time on EngineHosting.  I’m in Toronto, so Eastern Standard Time.  Both my personal local time (under My Account > Localization) and my system time (Admin > System Preferences> Localization Settings) are set to Eastern time.  My “Daylight Saving Time” and also my “Honor the Daylight Saving Time setting associated with each weblog entry?” are set to “no”.  Partly this is to avoid the DST problem all together, but also I had originally set it this way as I was moving between hosts, and wanted fine control without needing to worry about what setup they had.  Without DST, this puts me an hour “behind”, so I set my “Server Offset (in minutes)” to 60 to make up for it.

When I post, the date and time under “date” is the exact same as my local time, and it posts to screen with that time.

If you wanted the time an entry was posted without any reference to the localization of the author, {gmt_entry_date} is what you want.

The date the entry was submitted in GMT. This variable is not localized for each user’s date settings.

This entry was made on November 05th, 2007 @ 5:52 and filed into ExpressionEngine.

Comments

Jakob Buis wrote on November 06th, 2007 @ 13:50

IMHO this is one of the most minor concerns of webdesign: sure it’s an interesting read but most of the time I ‘solve’ the problem by using either local time as standard or GMT on international projects.

It’s such a small issue that I don’t think it’s worth much of my time.(nofi)

Post a Comment

Sorry, comments are automatically closed after 45 days, or sooner if one entry gets targetted by spammers. Why not contact me directly?