Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Convert UTC to local time

Author  Topic 

agastyamahi
Starting Member

33 Posts

Posted - 2014-08-01 : 01:08:28
Hey I have a stored procedure, it is accepting a parameter which is in local datetime format. But the front end application is passing UTC date format. Can you please let me know how I can convert UTC date time to local date time

Thanks

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2014-08-01 : 01:58:27
Check this out .I might help u

http://sqlserverperformance.wordpress.com/2007/04/25/one-way-to-convert-from-utc-time-to-local-time/

Vijay is here to learn something from you guys.
Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-08-01 : 11:53:51
quote:
Originally posted by vijays3

Check this out .I might help u

http://sqlserverperformance.wordpress.com/2007/04/25/one-way-to-convert-from-utc-time-to-local-time/

Vijay is here to learn something from you guys.

The method shown in that link can give you the wrong results in places that use day light savings time.

If the today happens to be in the daylight savings time period and the date you are trying to convert happens to be in the standard time period (or vice versa), the results will be off.

Accounting for this effect is complicated by the varying start and end dates for daylight savings time in various countries.
Go to Top of Page
   

- Advertisement -