PreviousNext

The tm Structure

The tm structure is based on the time in years, months, days, hours, minutes, and seconds since 00:00:00 GMT (Greenwich Mean Time), 1 January 1900. The tm structure is defined in the time.h header file.

The tm structure declaration follows:

struct tm {

int tm_sec; /* Seconds (0 - 59) */

int tm_min; /* Minutes (0 - 59) */

int tm_hour; /* Hours (0 - 23) */

int tm_mday; /* Day of Month (1 - 31) */

int tm_mon; /* Month of Year (0 - 11) */

int tm_year; /* Year - 1900 */

int tm_wday; /* Day of Week (Sunday = 0) */

int tm_yday; /* Day of Year (0 - 364) */

int tm_isdst; /* Nonzero if Daylight Savings Time */

/* is in effect */

};

Not all of the tm structure fields are used for each routine that converts between tm structures and utc structures. (See the parameter descriptions contained in the reference pages in the OSF DCE Application Development Referencefor additional information about which fields are used for specific routines.)