int tm_rd( struct tm * t );
Description
- Reads the current system time from
SEC_TIMER into the structure t.
- WARNING: The variable
SEC_TIMER is initialized when a program is started. If you change
the Real Time Clock (RTC), this variable will not be updated until you restart a program, and
the tm_rd() function will not return the time that the RTC has been reset to. The
read_rtc() function will read the actual RTC and can be used if necessary.
Parameters
- t
- Pointer to structure to store time and date.
-
struct tm {
char tm_sec; // seconds 0-59
char tm_min; // 0-59
char tm_hour; // 0-23
char tm_mday; // 1-31
char tm_mon; // 1-12
char tm_year; // 80-147 (1980-2047)
char tm_wday; // 0-6 0==Sunday
};
Return value
-
0: Successful.
-1: Clock read failed.
Library
- RTCLOCK.LIB
See also
- mktm, mktime, tm_wr