As described here and here, there is a difference between UTC and GPS Time because UTC occasionally has a leap second applied.
As of 2021 the difference is 18 seconds. So currently the equation is:
var gpsTime = utcDate.AddSeconds(18);
I need to calculate the gpsTime for all kinds of dates (past and near future). I could store a list of leap seconds and work out the GPS delta in play at any particular date. But I don't want the future maintainers of this code to have to remember to manually update the list whenever a new leap second comes along. Rather, it would be nice to use a library (maintained by the open source community) which is always up to date.
So is anyone aware of a library which can either:
- Convert UTC to GPS time, or
- Provide a list of Leap seconds?
Do any of these exist within the .NET framework or in some library on Nuget?