开发者

Timezone Incorrect by 30mins

My SQL Server appears to be on AU ESDT instead of AU ACSDT time, however the Server (Server 2008) has the correct timezone on AU ACSDT, is there any way to find and resolve the problem?

When I run:

SELECT GETUTCDATE(), GETDATE(), DATEDIFF(HOUR, GETDATE(), 开发者_如何学GoGETUTCDATE()) ;

The results that I get are:

2010-12-06 01:47:57.207 2010-12-06 12:17:57.207 -11

A DB I have stores its dates in UTC format and when I calculate the correct TZ offset it is always off by 30mins.

Any assistance is greatly appreciated.

Environment: SQL Server 2005 x64 SP3 (9.0.4035) MS Server 2008 x64 SP1


ACDT is UTC+10.5, AEDT is UTC+11

When you say you "calculate the correct TZ offset", are you sure it's correct? From your query it looks like SQL is using ACDT, since the GETUTCDATE+10.5 turns out to be the same result of GETDATE (01:47 + 10.5 = 12:17).


even though you mentioned that your server time is correct, but have you actually checked on the "server System Time"? It is under the "Administrative" tab on the server Control Panel

The reason I am saying this is simply because of the fact that even you can adjust the server time through the small "clock" appears on the bottom right corner of your server, but this is not the correct way to change


Yep it was my mistake, the timezone and output time were correct it just the minutes were not returning in my query so the time was being rounded.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜