Structure that describes calendar time
#include <time.h>
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long int tm_gmtoff;
const char * tm_zone;
};
The tm structure describes the calendar time.
The members of this structure include:
- tm_sec
- Seconds after the minute, in the range [0,61], allowing for leap seconds.
- tm_min
- Minutes after the hour, in the range [0,59].
- tm_hour
- Hours after midnight, in the range [0,23].
- tm_mday
- Day of the month, in the range [1,31].
- tm_mon
- Months since January, in the range [0,11].
- tm_year
- Years since 1900.
- tm_wday
- Days since Sunday, in the range [0,6].
- tm_yday
- Days since January 1, in the range [0,365], allowing for leap years.
- tm_isdst
- Daylight saving time flag.
- tm_gmtoff
- Offset from UTC — see
setlocale().
- tm_zone
- String for the time zone name.
ANSI,
POSIX 1003.1
asctime(),
gmtime(),
gmtime_r(),
localtime(),
localtime_r(),
mktime(),
setlocale(),
strftime(),
wcsftime()