Convert gmt to pst c#
DATEADD(hh, datediff(hh, getutcdate(), getdate()), [TimeUTC]) as [LocalTime]
Unlike the earlier orignal function in article this one returns table value this will definitely help performance. Of course you will have to change the code where you call the function adding a sub select. All in all it helps in CPU cycles more than on time taken for execution.
select convert(datetime, '2009-12-04 00:00:00.997')
select convert(datetime, '2009-12-04 00:00:00.998')
select convert(datetime, '2009-12-04 00:00:00.999')
timezoneoffset.jar 2001 2010
you should find it works.
My Recent Article : Ajax Calendar Control
Web03 | 2.8.171207.1 | Last Updated 18 Mar 2009
Everything else Copyright © CodeProject, 1999-2017