Is the Permalink GMT/DST date/time shift problem real? It’s called a fatal flaw by Blivet.com ( http://www.blivet.com/blog/2004/03/21/and-wordpress-is-driving-me-to-textpattern )
Here’s the description:
“WordPress stores blog entry dates in Greenwich Mean Time (GMT). Whenever WordPress builds a SQL query for blog entries by date, it must make an adjustment with an optional offset for the author’s current time zone. For example, this would be 8 hours for me during Pacific Standard Time (PST) and 7 hours during Pacific Daylight Saving Time (PDT).
For about six months of the year the WordPress system works fine, providing the author doesn’t move between time zones. But when it’s time for everyone to change to or from Daylight Saving Time, the WordPress system breaks down. What happens? All the blog entries which fall outside the new time zone are shifted by one hour, possibly breaking date-based permanent links!
It’s easy to see the potential for this breakage in my previous blog entry. I posted that between 11 p.m. and midnight on Thursday, March 11. If I was using a date- and title-based archive nomenclature then the permanent link might be:
Or some such. Well, as soon as Daylight Saving Time kicks in on April 4 of this year, that blog entry will suddenly be shifted to March 12 between midnight and 1 a.m.! Which means that WordPress would change its permanent link as well.
What’s worse is that this can’t be easily fixed in WordPress. You can’t just adjust for Daylight Saving Time in the SQL query because you could be getting back a range of results across time zones. Storing the dates in GMT essentially loses the context of the original time zone in terms of the way WordPress constructs its SQL queries.
Even though WordPress is very powerful and versatile, this date shifting really sucks. Especially for someone like me who’s made a large number of posts around midnight. Like this one.
- The topic ‘Is Permalink GMT/DST Flaw Real and Fatal?’ is closed to new replies.