Monday, May 16, 2011

Convert GPS week/seconds to local date time Google Gadget

Note: A WebApp version of this Google Gadget is available here http://dominoc925-pages.appspot.com/webapp/calc_gpstime/default.html.

The GPS date is normally expressed as a week number and a seconds-into-week number. This format is not quite as easy to work with as normal date time. For that reason, this calculator was written to help convert the GPS week-seconds format into a local date time form that can be easier to read. The gadget will incorporate the GPS leap seconds from 1980 to 2012 into the conversion.

For more information about GPS Time, go to http://www.oc.nps.edu/oc2902w/gps/timsys.html.

To use the calculator, simply do the following:
  1. Enter the GPS Week and GPS Seconds with a comma as the delimiter, 
  2. Select the desired local time zone, and 
  3. If necessary, select the desired local date time format in the Pref tab. 
  4. Click the Convert to local time button


7 comments:

bhargava said...

Thanks. Will this page be updated if leap seconds are added in future?

dominoc925 said...

Bhargava, yes

martin said...

hi dominoc,
i think in the coversion algorithm is some kind of bug, at least in this example:
116,3601 -> 1982/03/28 01:00:00
116,7199 -> 1982/03/28 01:59:58
116,7201 -> 1982/03/28 01:00:00

although in your android app, these gps times are coverted all right

dominoc925 said...

hi Martin
I'm sorry I cannot reproduce
116,7201 -> 1982/03/28 01:00:00
The gadget is converting correctly to
116,7201 -> 1982/03/28 02:00:00

martin said...

But not on mine pc, I always got wrong value not only for 116,7201
-> 1982/03/28 01:00:00, but even for succesive. The values were shifted for 1 hour. But it didn't depend on local time zone. I choosed these 116,3601 and 116,7201 as I recognise they return me equal output values.
Well this might be a problem of google gadget implementation, which I don't understand how it works.
I tried to use your app as a reference to test my conversion function. So I understand it needs to be carefull to all results anyway.
Thank you for response dominoc.

dominoc925 said...

Hi Martin,
I have figured out the cause of the problem. It's the daylight savings time in effect now that is affecting the date calculations.
Thx for letting me know.
rg

dominoc925 said...

DST has been neutralized in the code.