Open System Services System Calls Reference Manual (G06.28+)
gmtime_r(2) OSS System Calls Reference Manual
NAME
gmtime_r - Converts time since the Epoch to broken-down Coordinated Universal Time (reen-
trant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <time.h>]
#include <spthread.h>
struct tm *gmtime_r (
const time_t *timer,
struct tm *result );
PARAMETERS
timer Points to a variable that specifies a time value in seconds.
result Points to the struct tm where the converted time is stored.
DESCRIPTION
The gmtime_r() function is the reentrant version of the gmtime() function.
The gmtime_r() function converts the time in seconds since the Epoch, in a variable pointed to
by the timer parameter, into broken-down time, expressed as UTC (Coordinated Universal
Time). Broken-down time is stored in the type tm structure pointed to by the return value of the
gmtime_r() function. The broken-down time is also stored in the structure pointed to by result.
The tm structure is defined in the time.h header file.
RETURN VALUES
Upon successful completion, the gmtime_r() function returns a pointer to a type tm broken-
down time structure, which contains converted UTC time information. The pointer to the
broken-down time structure is also returned as result.
The return value of the function might point to static storage, which might be overwritten by sub-
sequent calls to any of the following functions:
asctime()
asctime_r()
ctime()
ctime_r()
localtime()
localtime_r()
gmtime()
gmtime_r()
Values for the timeptr->tm_wday and timeptr->tm_yday members of the structure are set, and
the other members are set to specified times since the Epoch. The final value of
timeptr->tm_mday is not set until the values of members timeptr->tm_mon and
timeptr->tm_year are determined.
When an error occurs or UTC is not available, this function returns a null pointer.
Note that the tm_isdst field of the tm structure is always set to 0 (zero) by a call to the
gmtime_r() function.
3−108 Hewlett-Packard Company 527186-005