Creating an AbsoluteDate with createJDDate() at TDBscale introduces error
I tried to create an AbsoluteDate
corresponding to 2460157.5 JDTDB like so:
TDBScale TDBscale = TimeScalesFactory.getTDB();
AbsoluteDate date = AbsoluteDate.createJDDate(2460157, Constants.JULIAN_DAY/2.0d, TDBscale);
The expected date is 2023-08-01T00:00:00.000, however date.toString(TDBscale)
gives 2023-07-31T23:59:59.99998730725312 instead.
As observed by @MaximeJ in the forum post, the discrepancy comes from the way createJDDate()
is written. It applies the offset of TDB from TAI at noon and then shifts the date by the fractional Julian day part. However, the offset from TAI is different at the final date than that at noon.
Edited by Simonas Stasevicius