Timezone differences - dealing with servers in other timezones

  • We have a SQL server in the eastern time zone, but our customers work on it across all timezones.

    #1 It appears that getdate() is always based on the server's time and not adjusted for which timezone the client is in.  Is this correct?

    #2 Is there a way to have SQL adjust the time from the server to the correct timezone?  Obviously I can select and subtract or add an hour times a stored constant (I am wondering if there is a simpler automatic way).  Is there a way to determine which timezone the client is in?

    #3 The time stored in the database is that based on the timezone or UTC?

    Someone has just pointed out GETUTCDATE() which is apparently a start, I am still curious if others have dealt with cross timezone functions.

    Thanks in advacne, Brian

  • #1 Yes, GETDATE() returns time based on the server. The server is unaware of any timezone information of the client.

    #2 No, not within out passing in something via a stored procedure parameter or the like and you performing a conversion process.

    #3 The time stored in a column of datetime doesn't presuppose a particular timezone. It just knows Dec 15, 2005 12:43 PM as just that, Dec 15, 2005 12:43 PM.

    K. Brian Kelley
    @kbriankelley

  • Thanks, Brian.  I was afraid of that.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply