April 1, 2009 at 2:53 pm
Does SQL automatically adjust dates to the locale of the connection. I am querying a server in one time zone from another and getting inconsistent results between datetime values before and after the clocks went forward in the UK.
Thanks
Buzz
April 1, 2009 at 3:14 pm
[font="Verdana"]I'm not sure, but I think that it does so, yes.
It should be fairly easy to put together a test and run it across your different locales to see what results you get.
SQL Server 2008 has a concept of "universal time" I believe to help alleviate this issue.
[/font]
April 2, 2009 at 6:22 am
I actually disagree with Bruce on this one, sorry Bruce. If you use GetDate(), SQL Server uses the locale of the SQL Server and if you set an explicitly defined date/time then SQL Server stores that date/time. A simple way to test this is to change the time zone on your PC and run Select getdate()
in SSMS against another SQL Server.
Now if you have users in different time zones using a web application that uses client side scripting to get a date, I don't know what you would end up with.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
April 2, 2009 at 9:43 am
Yes, I think what was happening is that the Timezone on SQL server in Central Europe was set to GMT but the app was generating local dates.
Thanks Again
Buzz
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply