Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

ctime(3) Guardian Native C Library Calls Reference Manual
NAME
ctime - Converts time since the Epoch into a date and time string
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <time.h>
char *ctime(
const time_t *timer);
PARAMETERS
timer Points to a variable that species a time value in seconds.
DESCRIPTION
The ctime() function converts the time in seconds since the Epoch, pointed to by the timer
parameter, to a character string. The Epoch is taken as 00:00:00 UTC January 1, 1970. The char-
acter string species local time in the following 26-byte format:
Sun Sep 16 01:03:52 1973\n\0
This format contains 5 elds and is terminated by a newline and a 0 (zero) byte.
Local time-zone information is set as though the tzset( ) function were called. This function is
equivalent to asctime(localtime(timer)).
RETURN VALUES
Upon successful completion, the ctime() function returns a pointer to a character string that
expresses the date and time in a xed format. The return value might point to static storage,
which might be overwritten by subsequent calls to any of the following functions:
asctime()
ctime()
localtime()
gmtime()
The value returned is affected by the setting of the TZ environment variable and calls to the
tzset( ) function. Refer to the tzset(3) reference page for more information about the TZ environ-
ment variable.
On error, this function returns a null pointer.
ERRORS
No error values are returned. This function does not set errno.
RELATED INFORMATION
Functions: asctime(3), difftime(3), getenv(3), gmtime(3), localtime(3), mktime(3),
strftime(3), time(3), tzset(3), utime(3).
STANDARDS CONFORMANCE
The return of a null pointer to indicate an error is an HP extension to the XPG4 Version 2
specication.
146 Hewlett-Packard Company 527192-007