Frage

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.

War es hilfreich?

Lösung

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
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top