In SQL Server 2008 R2 if I do:
select SYSDATETIMEOFFSET()
I get back GMT -6.
The TimeZone in Windows that SQL Server is running on is set GMT -7.
Any ideas why there is a difference? Is there somewhere in SQL Server I need to set the TimeZone?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would guess this is due to Daylight Saving Time being active. Your timezone is officially titled “GMT-7” meaning that normally (not in the Daylight Saving Time part of the year) your time is 7 hours earlier than GMT. But during Daylight Saving Time, that time is adjusted (usually by an hour, but can differ by timezone). So if you were currently in Daylight Saving Time, even though you are in the “GMT-7” timezone, your clock is currently only GMT-6 (6 hours earlier than GMT). I suspect SYSDATETIMEOFFSET() is telling you your actual offset from GMT at the moment as opposed to your timezone’s “normal” offset from GMT.