Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/l/localtime.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/l/localtime.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/l/localtime.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/l/localtime.html on line 8

localtime()

Convert calendar time to local time

Synopsis:

#include <time.h>

struct tm *localtime( const time_t *timer );

Arguments:

timer
A pointer to a time_t object that contains the calendar time that you want to convert.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The localtime() function converts the calendar time pointed to by timer into local time, storing the information in a struct tm. Whenever you call localtime(), it calls tzset().

You typically get a calendar time by calling time(). That time is Coordinated Universal Time (UTC, formerly known as Greenwich Mean Time or GMT).


Note: The localtime() function places the converted time in a static tm structure that's reused each time you call localtime() or gmtime(). Calling asctime() or ctime() could also change the data in this static buffer.

In a multithreaded application, use localtime_r().


You typically use the date command to set the computer's internal clock using Coordinated Universal Time (UTC). Use the TZ environment variable or _CS_TIMEZONE configuration string to establish the local time zone. For more information, see Setting the time zone in the Configuring Your Environment chapter of the Neutrino User's Guide.

Returns:

A pointer to the static tm structure containing the time information.

Classification:

ANSI, POSIX 1003.1

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread No

See also:

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

Setting the time zone in the Configuring Your Environment chapter of the Neutrino User's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/l/localtime.html on line 173

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/l/localtime.html on line 173