Thursday, June 28, 2012

Time zones and SQL databases

While working on a project I’ve encountered a need to store time and date information.

Over the past 15 years or so I’ve seen many different frameworks and libraries fail colossally when it comes to dates and times.To mitigate against these issues I went with what was considered best practice around the time I last looked into dates and times: store timestamps in UTC, render them in local time.

This makes date arithmetic easier since UTC doesn’t change during Daylight Savings Time (DST) whereas any given locale’s offset from UTC does change depending on the whether or not DST is in effect. And DST itself gets periodically redefined.

Out of curiosity I wondered when Microsoft’s SQL Server added time zone awareness? Was it much later than Oracle?

Oracle 9i, released in 2001, has the first reference I can find to time zone awareness in Oracle’s date and time formats.

SQL Server’s 2008 release has the first reference I can find to time zone awareness in its date and time formats.

That’s at least 7 years later. Seriously?

No comments :

Post a Comment