OSF DCE Application Development Guide--Core Components

Introduction to the Distributed Time Service API
The API provides the necessary routines for converting between opaque binary
timestamps and character strings that can be displayed and read by users.
19.2.2 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 Reference for additional information
about which fields are used for specific routines.)
19.2.3 The timespec Structure
The timespec structure is normally used in combination with or in place of the tm
structure to provide finer resolution for binary times. The timespec structure is similar to
the tm structure, but the timespec structure specifies the number of seconds and
nanoseconds since the base time of 00:00:00 GMT, 1 January 1970. You can find the
structure in the dce/utc.h header file.
The timespec structure declaration follows:
struct timespec {
time_t tv_sec; /* Seconds since 00:00:00 GMT, */
/* 1 January 1970 */
long tv_nsec; /* Additional nanoseconds since */
/* tv_sec */
} timespec_t;
124245 Tandem Computers Incorporated 197