문제

This is the data packet which was received from android mobile to my server.

  $|351746051743568|12.9399604|77.6257631|0.0|1392979784822|1|#

In which following is the time which is received from the device: 1392979784822. Since this is in GPS format, I tried to convert into local format in SQL and failed. Please guide me in this issue.

도움이 되었습니까?

해결책

Looks like unix/epoch time in millisecs?

declare @x bigint = 1392979784822
declare @msin1day bigint = 3600 * 24 * 1000

select dateadd(ms, @x % @msin1day, dateadd(day, @x / @msin1day, '19700101'))

(No column name)
2014-02-21 10:49:44.823
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top