/* Calculate seconds since Jan 1 1980 for the supplied rtcTime_t.  */
uint32_t rtcToSecondsSince1980(rtcTime_t *t)
/* Calculate seconds since Jan 1 1980 for the supplied rtcTime_t.  */
uint32_t rtcToSecondsSince1980(rtcTime_t *t)
{
    if (t->years < 80)
    {
        return 0;
    }
    return rtcGetEpochDate(t->years, t->months, t->days) * 86400 + t->hours
        * 3600 + t->minutes * 60 + t->seconds - 315532800;
}