Re: Dates & international representation
Date: Fri, 25 Aug 2000 21:39:51 GMT
Message-ID: <8o6p34$lc9$1_at_nnrp1.deja.com>
>> Is there a general approach to translating times in a SQL database
(MS SQL Server in my case) to local time from UTC? At my last job, we
had a table for translating cities to offsets and a table for daylight
savings, but that led to joins and calculations that I hope are
unnecessary. <<
You got it! The SQL-92 Standard has such a table in the Schema
Information tables. All SQL is supposed to be in UTC and translated
toocal time.
This schema information table holds the time zone and daylight saving
time (i.e. "Lawful time") and the system is supposed to convert it. We
also use the leap second in the Standard.
The general problem for the world is a mess. We had lawful time zones
which were not a even number of hours off of UTC until two years ago.
--CELKO--
Joe Celko, SQL and Database Consultant
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc)
which can be cut and pasted into Query Analyzer is appreciated.
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Aug 25 2000 - 23:39:51 CEST