localtime()

convert time in seconds since Epoch to local time 

Function


SYNOPSIS

#include <time.h>

struct tm *localtime(const time_t *clock);


DESCRIPTION

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.


PARAMETERS

clock 

Is the time to be converted.


RETURN VALUES

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.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

Refer to tzset() for details on setting time zone information.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
asctime(), asctime_r(), clock(), ctime(), ctime_r(), difftime(), gmtime(), gmtime_r(), localtime_r(), mktime(), strftime(), time(), tzset(), wcsftime()


PTC MKS Toolkit 10.4 Documentation Build 39.