Page 1 of 1

Converting GPS timestamp to actual Date / Time

Posted: Fri Mar 15, 2019 7:13 pm
by simon.schvartzman
As I'm a lazy animal before I start a test & try process I would like to check if anybody has already implemented a routine to convert the timestamp returned by the GPS

Code: Select all

   put mobileSensorReading ("location", true) into tDetails
   put tDetails["timestamp"] into ActTimeStamp
 
to the actual Date & Time. (don't care for the time zone for now)

According to the dictionary (point for me Klaus) :
"timestamp": the time at which the measurement was taken, in seconds since 1970.
But it doesn't specify "since when" in 1970, would it be:

January 1, 1970 00:00:01 or
December 31, 1970 23:59:59 or
Nov 6, 1970 11:32 AM (Neptune enters Sagittarius)

Anyone?

Thanks

Re: Converting GPS timestamp to actual Date / Time

Posted: Fri Mar 15, 2019 7:16 pm
by Klaus
It is: January 1, 1970 00:00:01

Re: Converting GPS timestamp to actual Date / Time

Posted: Fri Mar 15, 2019 7:38 pm
by simon.schvartzman
Thanks Klaus! As most of the times LC positively surprises me making things really easy...

And the answer is:

Code: Select all

put mobileSensorReading ("location", true) into tDetails
put tDetails["timestamp"] into ActTimeStamp
convert ActTimeStamp from seconds to dateItems

Re: Converting GPS timestamp to actual Date / Time

Posted: Fri Mar 15, 2019 8:44 pm
by dunbarx
Why limit oneself to the winter after Woodstock?

viewtopic.php?f=9&t=26619&p=138530&hili ... ng#p138530

Craig Newman