Даю пример портирования функции time
time_t time(time_t *timer)
{
struct tm t;
time_t tt;
RTC_DATE date;
RTC_TIME tim;
RTC_GetDate(0, &date);
t.tm_year = (date.year + date.century*100) - 1900;
t.tm_mday = date.day;
t.tm_mon = date.month;
t.tm_wday = date.weekday;
RTC_GetTime(0, &tim);
t.tm_hour = tim.hours;
t.tm_isdst = 0;
t.tm_min = tim.minutes;
t.tm_sec = tim.seconds;
tt = mktime(&t);
if(timer!=0)
{
*timer = tt;
}
return tt;
}