/* Convert the supplied rtcTime_t to the equivalent epoch time.  */
uint32_t rtcToEpochTime(rtcTime_t *t)
/* Convert the supplied rtcTime_t to the equivalent epoch time.  */
uint32_t rtcToEpochTime(rtcTime_t *t)
{
    if (t->years < 70)
    {
        return 0;
    }
    return rtcGetEpochDate(t->years, t->months, t->days) * 86400 + t->hours
        * 3600 + t->minutes * 60 + t->seconds;
}