buf - pointer to a struct tm object to store the result
1 2 3 4 5 6 7 8 9 10 11
struct tm { int tm_sec; /* seconds */ int tm_min; /* minutes */ int tm_hour; /* hours */ int tm_mday; /* day of the month */ int tm_mon; /* month */ int tm_year; /* year */ int tm_wday; /* day of the week */ int tm_yday; /* day in the year */ int tm_isdst; /* daylight saving time */ };
Return value
1)
pointer to a static internal tm object on success
or null pointer otherwise. The structure may be shared between gmtime, localtime, and ctime and may be overwritten on each invocation.
2-3)
copy of the buf pointer
or null pointer on error (which may be a runtime constraint violation or a failure to convert the specified time to local calendar time)
usage
Converts given time since epoch (a time_t value pointed to by timer) into calendar time, expressed in local time, in the struct tm format. The result is stored in static storage and a pointer to that static storage is returned.
Same as (1), except that the function uses user-provided storage buf for the result.
Same as (1), except that the function uses user-provided storage buf for the result and that the following errors are detected at runtime and call the currently installed constraint handler function: