I have found only one similar question but for MySQL.
I was working on a web service and had to query the database (MS SQL server). Since I couldn\'t get the right
This should work perfect for those long epoch times.
SELECT DATEADD(SECOND, 1359016610667 / 1000, '19700101 00:00')
Easy, first add whole days, then add the remaining ms. There are 86,400,000 milliseconds in a day.
declare @unixTS bigint
set @unixTS = 1359016610667
select dateadd(ms, @unixTS%(3600*24*1000),
dateadd(day, @unixTS/(3600*24*1000), '1970-01-01 00:00:00.0')
)
The result is 2013-01-24 08:36:50.667