关于java:GPS时间表示库

GPS Time Representation library

我正在寻找一个Java库,处理转换到/从GPS时间。

GPS时间是1980年1月6日的一个时期,没有闰秒,因此它不同于更标准的时间表示。以下是维基百科的相关描述:

While most clocks are synchronized to Coordinated Universal Time (UTC), the atomic clocks on the satellites are set to GPS time. The difference is that GPS time is not corrected to match the rotation of the Earth, so it does not contain leap seconds or other corrections which are periodically added to UTC. GPS time was set to match Coordinated Universal Time (UTC) in 1980, but has since diverged. The lack of corrections means that GPS time remains at a constant offset with International Atomic Time (TAI) (TAI - GPS = 19 seconds). Periodic corrections are performed on the on-board clocks to correct relativistic effects and keep them synchronized with ground clocks.

The GPS navigation message includes the difference between GPS time and UTC, which as of 2009 is 15 seconds due to the leap second added to UTC December 31, 2008. Receivers subtract this offset from GPS time to calculate UTC and specific timezone values. New GPS units may not show the correct UTC time until after receiving the UTC offset message. The GPS-UTC offset field can accommodate 255 leap seconds (eight bits) which, given the current rate of change of the Earth's rotation (with one leap second introduced approximately every 18 months), should be sufficient to last until approximately the year 2300.

As opposed to the year, month, and day format of the Gregorian calendar, the GPS date is expressed as a week number and a seconds-into-week number. The week number is transmitted as a ten-bit field in the C/A and P(Y) navigation messages, and so it becomes zero again every 1,024 weeks (19.6 years). GPS week zero started at 00:00:00 UTC (00:00:19 TAI) on January 6, 1980, and the week number became zero again for the first time at 23:59:47 UTC on August 21, 1999 (00:00:19 TAI on August 22, 1999). To determine the current Gregorian date, a GPS receiver must be provided with the approximate date (to within 3,584 days) to correctly translate the GPS date signal. To address this concern the modernized GPS navigation message uses a 13-bit field, which only repeats every 8,192 weeks (157 years), thus lasting until the year 2137 (157 years after GPS week zero).

我不想自己滚;我在佐达时间里看不到任何东西表明它可以处理GPS编码的日期。有没有办法延长?


JSR-310具有TAIInstantUTCInstant类,这有助于解决这个问题(因为GPS时间尺度是TAI的一个变化)。这些都位于三个额外项目中。


这个网站似乎在用javascript进行转换。链接文本


你能详细说明你想做什么吗?

如果您正在从GPSR读取数据,则应根据您的报价更正NMEA流中的UTC漂移,并由此进行确认。