if(requireNamespace("asteRiskData", quietly = TRUE)) {
# Let's calculate the MJD of the 12th of June, 2000 at 10:00:00 UTC time, in UTC
MJD_UTC <- dateTimeToMJD("2000-06-12 10:00:00", timeSystem = "UTC")
# Let's now calculate the MJD for the same instant in TDB:
MJD_TDB <- dateTimeToMJD("2000-06-12 10:00:00", timeSystem = "TDB")
# We can now calculate the difference in seconds, which matches the difference
# between UTC and TDB for that day:
(MJD_UTC - MJD_TDB) * 86400
}
Run the code above in your browser using DataLab