May 2003
Intermediate to advanced
808 pages
32h 24m
English
tm struct — Represents the parts of a date and time
struct tm {
int tm_sec; /* Seconds: 0-61 */
int tm_min; /* Minutes: 0-59 */
int tm_hour; /* Hours: 0-23 */
int tm_mday; /* Day of month: 1-31 */
int tm_mon; /* Month: 0-11 */
int tm_year; /* Years since 1900 */
int tm_wday; /* Days since Sunday: 0-6 */
int tm_yday; /* Days since January 1: 0-365 */
int tm_isdst; /* Daylight Savings Time */
}The tm structure stores
parts of a date and time. The values returned by localtime and gmtime will always be in the ranges shown
above. (Note that two extra leap seconds are allowed for tm_sec.)
The tm_isdst member is
positive when Daylight Savings Time is in effect, 0 when it is not in effect, or negative if
it is unknown.
The order of the members is implementation-defined. An implementation can have additional members.
gmtime function, localtime function, mktime function, time_t type
Read now
Unlock full access