The header <time.h> defines two macros, declares four types and several functions for manipulating time. Many functions deal with a calendar time that represents the current date (according to the Gregorian calendar) and time. Some functions deal with local time, which is the calendar time expressed for some specific time zone, and with Daylight Saving Time, which is a temporary change to the algorithm for determining local time. The local time zone and Daylight Saving Time are implementation-defined.
The macros defined are NULL (described in ANSI C 7.1.6); and CLOCKS_PER_SEC which is the number per second of the value returned by the clock function.
The types declared are size_t (described in ANSI C 7.1.6), clock_t and time_t, which are arithmetic types capable of representing times, and struct tm which holds components of a calendar time, called the broken-down time.
The structure struct tm is defined as follows:
struct tm { int tm_sec; /* seconds after the minute [0,61] */ int tm_min; /* minutes after the hour [0,59] */ int tm_hour; /* hour of the day [0,23] */ int tm_mday; /* day of the month [1,31] */ int tm_mon; /* month of the year [0,11] */ int tm_year; /* years since 1900 */ int tm_wday; /* days since Sunday [0,6] */ int tm_yday; /* day of the year [0,365] */ int tm_isdst; /* Daylight Saving Time flag */ };
The member tm_isdst is:
positive if Daylight Saving Time is in effect |
zero if Daylight Saving Time is not in effect |
negative if the information is not available |