Manikandan R

Manikandan R

  • 1.6k
  • 166
  • 4.6k

Timestamp Data convert

Mar 25 2023 5:58 AM

Hi,

I need to convert Timestamp Data of (1679722784640) this to datetime format in sql server, i successfully converted the data referring this suggestion stackoverflow.com/a/3650475/14329025  but  i need a clarification of   what is the need of inputing ('1-1-1970 05:30:00') this date particularly, in case change the date or month or year ouput data show wrongly

--Unix timestamps input (1679722784640) to get Date and Time 2023-03-25 11:09:44

select dateadd(s, convert(bigint, 1679722784640) / 1000, convert(datetime, '1-1-1970 05:30:00'))

 


Answers (2)