[Top] [All Lists]

Re: Adjusting to user's local time

Subject: Re: Adjusting to user's local time
From: Andy
Date: Mon, 23 Jul 2007 07:45:18 -0700
Newsgroups: microsoft.public.sqlserver.notificationsvcs
On Jul 19, 8:18 am, Todd C <[email protected]> wrote:
> Why not do this:
> [Expiration in Local Time] = DateAdd(hour, DateDiff(hour, GETUTCDATE(),
> GETDATE()), [Expiration in UTC Time])
> One caution: This only applies to records where the [Expiration Date] is in
> the same Daylight Savings timeframe as the current date. In other words, this
> is accurate if you are looking at an [Expiration  Date] coming up in a week.
> But if you are looking at an [Expiration Date] that will be in, say, November
> or December (after the U.S. has gone off Daylight Savings Time) then you will
> be off by one hour.
> The choice is yours: If that one hour difference is acceptable for 6 months
> out of the year, then it will work. If not, you will need to figure out
> something else.

Well the problem is that users may be in China, France, or Germany,
and this only accounts for users in the same timezone in which the
server is located.

<Prev in Thread] Current Thread [Next in Thread>