I’m looking for an efficient SQL Server function (in my case 2005) to convert a unix time value into a SQL Server datetime, using local time (particularly taking account of summertime adjustments – i.e not just adding 01/01/1970 in seconds)
Share
After you have the date, you can now do dateadd on the date depending on the DST state for the returned date. To check for DST you need some form of function, sample:
You need a simular function to find when DST ends, take a look at this site for more info:
http://www.mssqltips.com/tip.asp?tip=1372