This function converts a Coordinated Universal Time (UTC) calendar date (year, month, day, hour, minute, second) into a Barycentric Dynamical Time (TDB) Julian Date.

The result is returned as two double-precision floating-point numbers (jd0_tdb and jdfrac_tdb) to preserve precision.

This function performs the following transformation chain internally:

  1. Converts the UTC calendar date to a UTC Julian Date.

  2. Computes the difference between UTC and TT (Terrestrial Time) using leap second data.

  3. Converts TT to TDB using calceph_time_jd_tt_to_jd_tdb().

This function requires that the ephemeris file associated to eph contains both leap second constants (for UTC → TT) and the necessary data for the TT → TDB transformation that can be initialized with calceph_time_set_relationship_tt_tdb().

The following example converts a UTC calendar date to TDB:

t_calcephbin *peph;
double jd0_tdb, jdfrac_tdb;
int yy = 2010, mm = 6, dd = 1;
int hh = 0, min = 0;
double sec = 0.0;

/* open the ephemeris file */
peph = calceph_open("example_lsk.tls");
if (peph != NULL)
{
    /* Direct conversion: UTC Calendar -> TDB JD */
    if (calceph_time_cal_utc_to_jd_tdb(peph, yy, mm, dd, hh, min, sec,
                                       &jd0_tdb, &jdfrac_tdb) != 0)
    {
        printf("TDB Julian Date: %f + %f\n", jd0_tdb, jdfrac_tdb);
    }

    calceph_close(peph);
}