(ANSI Standard)
#include <time.h> tim = gmtime(timeptr);
"gmtime" expands a time number into a structure containing a number of integers giving values for the time expressed in Greenwich Mean Time. The structure includes the following fields:
struct tm {
/* ANSI standard fields */
int tm_sec; /* seconds (0-60) */
int tm_min; /* minutes (0-59) */
int tm_hour; /* hours (0-23) */
int tm_mday; /* month day (1-31) */
int tm_mon; /* month (0-11) */
int tm_year; /* year - 1900 */
int tm_wday; /* day of week (0-6) */
int tm_yday; /* year day (0-365) */
int tm_isdst; /* daylight savings? */
/* always zero with "gmtime", since
GMT is never Daylights Saving */
/* extensions to ANSI standard */
char *tm_zone; /* time zone name */
long tm_gmtoff; /* offset from GMT */
};
In this way, you can obtain any particular component of the date or time.
The C library determines GMT using the time zone definition file of the UW Tools package. For further information, see "expl b tz".
Copyright © 1996, Thinkage Ltd.