Does that work in SQL 2000?


I've always used _javascript_ at logon to determine the time zone of the
user's computer.  I then store the time zone offset in a cookie or
session/client variable.  I then use a UDF to convert the time from the
SQL server to that user's local time.


If there was a way to do this all in one single shot via SQL as it seems
you have a solution for below I'd love to try it out.  Unfortunately I
can't seem to make the example you gave below work in SQL 2000.


-Novak

-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 16, 2003 12:55 PM
To: CF-Talk
Subject: Re: Compensating for Server Time

Chris Montgomery wrote:
>
> What's the best way to compensate for time on a server in a hosted
> environment when the time is set to a different time than a user's
local
> time zone? Ex: client is in Central Time, server is on Eastern Time
(one
> hour ahead); client wants everything to reflect local time.

I use the AT TIME ZONE functionality from SQL, it even
compensates for daylight savings time:

testDB=> select '2003-12-31 12:00:00' AT TIME ZONE 'cet';
       timezone
---------------------
  2003-12-12 12:00:00

testDB=> select '2003-07-31 12:00:00' AT TIME ZONE 'cet';
       timezone
---------------------
  2003-06-12 11:00:00

Jochem

--
Who needs virtual reality
if you can just dream?
     - Loesje

  _____  


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to