Y204x bugs in lalapps_tconvert
Going from dates to GPS, lalapps_tconvert seems to do fine until early 2048 at which point it expectedly hits the limit of INT4 (2^31-1=2147483647):
lalapps_tconvert 2048-01-24
2147472018
lalapps_tconvert 2048-01-25
-2147408878
But the inverse, GPS->date, for some reason already breaks before 2040:
lalapps_tconvert 1832000000
Thu Dec 19 10:24:46 GMT 1901
Not sure if this is a bug on our side, or inherited from some upstream date formatting library...
Comparison test from @matthew-pitkin:
Interestingly astropy can do it both ways:
from astropy.time import Time
t = Time('2040-01-01T00:00:00.0', format='isot', scale='utc')
print(t.gps)
1893024018.0000002
t2 = Time(1893024018, format='gps', scale='utc')
print(t2.isot)
2040-01-01T00:00:00.000
Although it does give a ERFA "dubious year" warning.
Edited by David Keitel