Re^3: Converting GPS seconds to readable time&date
by derby (Abbot) on Jan 11, 2009 at 15:23 UTC
|
GPS, Global Positioning System time, is the atomic time scale implemen
+ted by the atomic clocks in the GPS ground control stations and the G
+PS satellites themselves. GPS time was zero at 0h 6-Jan-1980 and sinc
+e it is not perturbed by leap seconds GPS is now ahead of UTC by 15 s
+econds.
I'm not sure if your hardware is compensating for this diff and/or if it's just outputting standard UTC and saying it's GPS. You're better off listening to someone more GPS aware than I am (that is if you're really worried about that 15 second gap).
| [reply] [d/l] |
|
|
The easiest way to convert a GPS computed time, that you get from the receiver is to add the number of leap seconds reported by the GPS receiver's alminac. This takes about 20 minutes to get on a cold startup, and a few seconds on a warm one.
There's really no other foolproof way. I've tried a lot.
Next, if you want to optimize startup time, and also cope with the 'product on a shelf' problem, you have some alternatives:
(1) Grab the leap second file from NIST via FTP on startup if the GPS receiver doesn't know yet. This may be faster than waiting for it, and can be cached so that you only grab it every 6 months. Count the number of leap seconds since 1980.
(2) remember the last number of leap seconds, as well as the data from the GPS receiver that tells you 'pending' leap seconds. If you've not passed a leap second opportunity (December 31 or June 30th), the cache is valid. If you have, and there wasn't one scheduled, the cache is invalid and you have to wait.
I'm sure there are others, but the really only reliable way to convert the GPS time into UTC is to apply the leap second correction. You'll also want to confirm with the GPS data provider that the data is in GPS seconds, not UTC. Many GPS receivers do output UTC in their default mode of operation.
Warner
| [reply] |
|
|
| [reply] |
|
|
There was a recent show on the Discovery( or maybe History) Channel about GPS time. I guess the satellites are travelling fast enough, that they must take relativistic time dilation into account, or all ground positions would be way off. The satellites are aging more slowly than us on the ground, who are stuck in the muck of earth's gravity.
| [reply] |
|
|
| [reply] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The time displayed on the GPS is not really accurate, depending on what you consider accurate. I think some could be as much as a second or maybe two off. But it will be close enough to compare against www.time.gov to see if it is outputting UTC or GPS time. Also, in the setup menu of your GPS there just may be a field to change from one to the other.
| [reply] |
|
|
Not true. If you have a good GPS device that's meant to do time-transfer it should be able to get you within 10-100 microseconds of the correct time. Keeping accurate time is the foundation of the whole GPS system :)
| [reply] |
|
|
|
|
|
|
Well, the Unix time system doesn't consider leap seconds either. And since its epoch is at Jan 1, 1970, it is 24 seconds ahead of UTC. (Although, we all presume that our system clocks keep time in UTC...)
| [reply] |
|
|
| [reply] |