How to convert GPS time to TAI time to UTC time?

I had naively assumed that GPS time and TAI were the same thing until I saw this answer: https://space.stackexchange.com/a/22244/12508

I know that there are differences between Terrestrial Time (TT) and TAI of ~32.184 seconds, but that is only accurate to the millisecond place I think. The differences between TAI and UTC are the usual leap seconds [e.g., see Franz and Harper, 2002], but is that accurate to the nanosecond?

So suppose I am given GPS times and need to convert those to UTC and need to be accurate to the nanosecond. Can I simply use the ~19 second difference mentioned in David's answer to convert to TAI and then add on leap seconds to get UTC?

Must I give in and be forced to learn JPL's SPICE software?

Other relevant but not directly related questions:

References

1. Franz, M. and D. Harper "Heliospheric coordinate systems," Planet. Space Sci. 50, pp. 217--233, doi:10.1016/S0032-0633(01)00119-2, 2002.
• The answer to your question is here: en.wikipedia.org/wiki/Global_Positioning_System#Leap_seconds (TAI - GPS = 19 seconds) – Uwe Feb 24 at 17:07
• @Uwe - No, I don't think so. That's only accurate to something like the millisecond place, isn't it? I realize GPS has intrinsic uncertainties of 10s of ns, but if I need to know a time to at least that accuracy, will the 19 seconds be enough of a correction or is it only good to something like milliseconds? – honeste_vivere Feb 24 at 17:15
• Both TAI and GPS time are extremly precise clocks. Both time scales do not use leapseconds. So if there was a constant offset of 19 seconds in 1980, the offset is today still 19 seconds. If the offset would be different today, at least one time scale would be inprecise. The precision is about 1E-13 seconds, a nanosecond is 1E-9 seconds, a picosecond 1e-12. – Uwe Feb 24 at 17:26
• @Uwe - No, I get all that. I am asking if the offset is indeed 19 seconds down to a nanosecond. – honeste_vivere Feb 24 at 17:34

The US Naval Observatory says GPS time "during the last several years has been within a few hundred nanoseconds" of UTC(USNO), while UTC(USNO) "has been kept within 26 nanoseconds of UTC[BIPM] during the past year". The GPS performance standard for time transfer accuracy is less than 40 nanoseconds 95% of the time, but the International Earth Rotation Service's Tech Note 36 says "since the eccentricity $$e$$ for GPS orbits can reach up to 0.02, consequently the amplitude of [the additional relativistic correction needed beyond the one already built into the onboard clocks] can reach up to 46 ns." (page 154).