GPS & UNIX Time - LabVIEW-Open-Source/Epoch-Time GitHub Wiki
Unix and GPS Time computations are performed, including support for Leap Seconds. The library accounts for divergence of UTC and TAI (International Atomic Time) over time, to properly calculate GPS time.
###Epochs A series of Epoch classes are abstracted in the palette and can be used for even more granularity or to build new methods that migrate from one epoch to another. The base Epoch class represents the local system time, unless it is overwritten. Current overrides include UTC, Unix and GPS.
GPS Epoch starts on Jan 6th, 1980 Unix Epoch starts on Jan 1st, 1970 UTC Epoch starts on Jan 1st, 1904 TAI epoch starts on Jan 1st, 1900 and is used to calculate leap second differential between GPS and UTC. GPS is fixed to TAI, by definition, but with a 19 seconds offset.
GPS, TAI and UTC relationship
GPS clocks and International Atomic Time are continuous and evenly-spaced, whereas UTC compensates for the fluctuation of Earth's rotation to keep the "year" synchronized for human activities. Therefore, leap seconds are sometimes added or removed to UTC time. Based on the history of the number of leap seconds added to the UTC, one must use this look-up table to make the exact time conversions. Leap Seconds record is kept in a table maintained by an international consortium (https://www.ietf.org/timezones/data/leap-seconds.list)
Notable facts:
- UTC Time accepts "YYYY-12-31T23:59:60Z" to allow for leap seconds to be introduced (note the seconds segment = 60)
- GPS Clock is permanently offset from TAI by 19 seconds
- UTC is, in 2021, offset by 37 seconds from TAI... and 18 seconds from GPS (37s - 19s)