#include <time.h>
struct tm *localtime(const time_t *clock);
The localtime() function
converts a time in seconds since the Epoch (00:00:00 UTC, January
1, 1970) into a broken-down time, expressed as a local time. The
function corrects for the time zone and any seasonal adjustments.
Local time zone information is used as though localtime()
calls tzset().
A side-effect of calling localtime()
is that the global variables tzname, timezone,
and daylight are set based on the value of
environment variable TZ, exactly as though the function
tzset() had been called.
The tm structure returned by localtime()
is in the local time specified by TZ.
This function is not reentrant;
see localtime_r() for a reentrant version.
- clock
-
Is the time to be converted.
On success, the localtime() function returns a pointer
to a static structure containing the broken-down time.
This static buffer is shared with gmtime();
subsequent calls to localtime() or
gmtime() overwrite this buffer.
On error, it returns NULL.
ANSI/ISO 9899-1990.
Unsafe.
Refer to tzset()
for details on setting time zone information.
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
- Functions:
- asctime(), asctime_r(), clock(), ctime(), ctime_r(), difftime(), gmtime(), gmtime_r(), localtime_r(), mktime(), strftime(), time(), tzset(), wcsftime()
MKS Toolkit 9.2 Documentation Build 16.