Convert unix epoch timestamp to TSQL datetime

后端 未结 2 1570
[愿得一人]
[愿得一人] 2020-12-06 11:57

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

2条回答
  •  鱼传尺愫
    2020-12-06 12:26

    This should work perfect for those long epoch times.

    SELECT DATEADD(SECOND, 1359016610667 / 1000, '19700101 00:00')
    

提交回复
热议问题