0

I am having this format of datetime 1610382439.I am looking sql query to convert it to UTC time.

Salman A
  • 262,204
  • 82
  • 430
  • 521
Saswat Ray
  • 141
  • 3
  • 14

2 Answers2

1

One solution is to add those seconds to 1970-01-01. The datetime datatype does not adjust for DST:

select cast('1970-01-01' as datetime) + interval 1610382439 second
-- 2021-01-11 16:27:19
Salman A
  • 262,204
  • 82
  • 430
  • 521
0

In SQL server and .net world it called ticks. You can take a look at this link which shows how to convert it: Convert .NET Ticks to SQL Server DateTime

Reza Akraminejad
  • 1,412
  • 3
  • 24
  • 38