[Previous] [Contents] [Next]

gmtime_r()

Convert calendar time to a broken-down time

Synopsis:

#include <time.h>

struct tm* gmtime_r( const time_t* timer,
                     struct tm* result );

Library:

libc

Description:

The gmtime_r() function converts the calendar time pointed to by timer into a broken-down time, expressed as Coordinated Universal Time (UTC) (formerly known as Greenwich Mean Time or GMT) and stores it in the tm structure result.

The time set on the computer with the date command reflects Coordinated Universal Time (UTC). The environment variable TZ is used to establish the local time zone. See the section "The TZ environment variable" in the Global Data and the TZ Environment Variable chapter for a discussion of how to set the time zone.

Returns:

A pointer to a structure containing the broken-down time.

Classification:

POSIX 1003.1

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

See also:

asctime(), asctime_r(), clock(), ctime(), difftime(), localtime(), localtime_r(), mktime(), strftime(), time(), tm, tzset()


[Previous] [Contents] [Next]