#include #include time_t time(time_t *timeptr) { rtc_time_t rtc; struct tm tm; time_t calendar; rtc_get_time(&rtc); tm.tm_sec = rtc.seconds; tm.tm_min = rtc.minutes; tm.tm_hour = rtc.hours; tm.tm_mday = rtc.month_day; tm.tm_mon = rtc.month; tm.tm_year = rtc.year - 1900; tm.tm_isdst = 0; calendar = mktime(&tm); if(timeptr != NULL) *timeptr = calendar; return calendar; }