Converts a time value to broken-down local time.
#include <time.h> struct tm *localtime (const time_t *bintim);Function Variants Compiling with the _DECC_V4_SOURCE and _VMS_V6_SOURCE feature- test macros defined enables a local-time-based entry point to this function that is equivalent to the behavior before OpenVMS Version 7.0.
The function corrects for the time zone and any seasonal time adjustments. Local time-zone information is used as if localtime called tzset.
The converted time value is placed in a time structure defined in the <time.h> header file with the tag tm. Table 6 describes the member names that are offsets into the structure.
int tm_sec; | Seconds after the minute (0-60) |
int tm_min; | Minutes after the hour (0-59) |
int tm_hour; | Hours since midnight (0-23) |
int tm_mday; | Day of the month (1-31) |
int tm_mon; | Months since January (1-11) |
int tm_ year; | Years since 1900 |
int tm_wday; | Days since Sunday (0-6) |
int tm_yday; | Days since January 1 (0- 365) |
int tm_isdst; | Daylight
Savings Time flag
|
long tm_gmtoff;[1] | Seconds east of Greenwich (Negative values indicate seconds west of Greenwich) |
char *tm_zone;[1] | Time zone string, for example "GMT" |
[1] This field is an extention to the ANSI C tm structure. It is present unless you compile your program with /STANDARD=ANSI89 or with _DECC_V4_SOURCE defined. |
The type time_t is defined in the <time.h> header file as follows:
typedef long int time_t
pointer | A pointer to the time structure. |