Storing Time as GMT (server time zone is pacific )

  • The server is set the pacific time zone. All times are getting captured with respect to the pacific time zone. Now we want to store the timestamp as GMT without changing the timezone of the server.

    Is it possible ?

    If possible How ?

    Can we write s stored procedure to do this ?

  • Look at

    Select GETUTCDATE(),GetDate()

    BOL 2000:

    GETUTCDATE

    Returns the datetime value representing the current UTC time (Universal Time Coordinate or Greenwich Mean Time). The current UTC time is derived from the current local time and the time zone setting in the operating system of the computer on which SQL Server is running.

  • If you are using SQL 7 then check out this script.

    http://www.sqlservercentral.com/scripts/contributions/158.asp

    You will have to fix the time offsets which are noted from 4 and 5 to what yours are (I am eastern tz).

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

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