This function parses a time string representing a UTC date and converts it directly to a TDB Julian Date.
The function forces the interpretation of the input string as UTC, ignoring any potential timescale suffix present in the string. It then performs the full conversion chain (UTC → TAI → TT → TDB).
The following example converts a UTC string to TDB:
t_calcephbin *peph;
double jd0_tdb, jdfrac_tdb;
const char *utc_str = "2010-06-01T00:00:00";
/* open the ephemeris file */
peph = calceph_open("example_lsk.tls");
if (peph != NULL)
{
/* Parse UTC string and convert directly to TDB */
if (calceph_time_str_utc_to_jd_tdb(peph, utc_str, &jd0_tdb, &jdfrac_tdb) != 0)
{
printf("TDB Julian Date: %f + %f\n", jd0_tdb, jdfrac_tdb);
}
calceph_close(peph);
}