Or the utter chaos of time

One thing I've learned a lot about recently is time, timezones, DST and the utter complexity of mixing 'em all together. To bring further confusion into the equation, Spark CMS has to deal with several possibilities for what a function uses as its starting point for dates. This has lead to a lot of work related to time and dates lately...

Firstly, if you plan on developing anything that deals with time and/or dates, you're hereby advised that what the server, system, file-system or web server reports as being now not always is the same point in time. Before you start, do yourself a favor and check what format and for which timezone each source uses. Then there's the issue of DST...

Daylight saving time (also called DST, or summer time) is the portion of the year in which a region's local time is advanced by (usually) one hour from its official standard time. It is most common in temperate regions. Daylight saving time is a system intended to "save" daylight, as opposed to "wasting" time (for example, by sleeping long past sunup). The official time is adjusted forward during the spring and summer months, so that the active hours of work and school will better match the hours of daylight.

Ok, so DST basically is a good idea with some positive effects. The problem with it, at least from a software developers point of view, is that 24 hours from now might be two days and every sovereign state in the world seems to have implemented this nearly at random. If you take a look at the above quoted article, in particular the section "Observation of DST", you'll get an idea of how chaotic this can be. Most European countries have agreed on a single time and date for when DST is in effect, though Iceland doesn't use it and the UK insists on doing a second later than everybody else. Pakistan trailed it in 2002, the People's Republic of China from '86 to sometime in the '90s, but both countries dropped it. Most parts of the US use DST, though Hawaii, parts of Arizona, and most of southern Indiana doesn't. Although it seems like the world has been synchronized a bit in recent years, if and when DST have been observed in reality varies from country to country.

Regardless of the complexity I think I've got this nailed down now, hopefully everybody (users, servers, db, CMS, etc) gets the time they need/want whatever their timezone and DST status is. A result of this however is that for articles and posts (on this site) written prior to the 0.3.5 release, some timestamps may be slightly off. I could have gone through and checked the dates, but as I'm unbelievably tired of everything related to dates, I can't be bothered.

Couldn't generate page, however a cached copy was found and served on the 1st of January 1970 @ 00:00 in 0.016 seconds...

Errors occurred while generating this page... (More info availible)