/* Calculate number of days from Jan 1 1970 @prama year: import year to calculate month: import month to calculate day: import day to calculate.  */
uint32_t rtcGetEpochDate(uint32_t year, rtcMonths_t month, uint8_t day)
/* Calculate number of days from Jan 1 1970 @prama year: import year to calculate month: import month to calculate day: import day to calculate.  */
uint32_t rtcGetEpochDate(uint32_t year, rtcMonths_t month, uint8_t day)
{
    if (year >= 1900)
    {
        year -= 1900;
    }
    if ((year < RTC_MIN_EPOCH_YEAR) || (year > RTC_MAX_EPOCH_YEAR))
    {
        return 0;
    }
    uint8_t m = (uint8_t)(month & 0xFF);
    return (1461 * (year + 6700 + (m - 14) / 12)) / 4 + (367 *
        (m - 2 - 12 * ((m - 14) / 12))) / 12 -
        (3 * ((year + 6800 + (m - 14) / 12) / 100)) / 4 +
        day - 2472663;
}