Open System Services System Calls Reference Manual (G06.28+)
asctime_r(2) OSS System Calls Reference Manual
NAME
asctime_r - Converts broken-down time into a date and time string (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptdll
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <time.h>]
#include <spthread.h>
char *asctime_r (
const struct tm *timeptr,
char *buf );
PARAMETERS
timeptr Points to a type tm structure that contains the broken-down time.
buf Points to the buffer where the converted time is stored. This buffer must be at
least 26 bytes long.
DESCRIPTION
The asctime_r() function is the reentrant version of the asctime() function.
The asctime_r(), ctime_r(), difftime(), gmtime(), gmtime_r(), localtime(), localtime_r(),
mktime(), and tzset( ) functions are used to convert time units to strings, to store converted time
units for subsequent processing, and to convert stored time information to other time units. Time
information used in these functions is stored in a type tm structure, which is defined in the time.h
header file.
The asctime_r() function converts broken-down time information to a date and time string with
the following 26-byte format:
Sun Sep 16 01:03:52 1973\n\0
This format contains 5 fields and is terminated by a newline and a 0 (zero) byte.
RETURN VALUES
Upon successful completion, the asctime_r() function returns a pointer to a character string con-
taining the date and time. This string is pointed to by buf. On error, this function returns a null
pointer.
ERRORS
No error values are returned. This function does not set the errno variable.
RELATED INFORMATION
Functions: asctime(3), ctime(3), ctime_r(3), difftime(3), getenv(3), gmtime(3), gmtime_r(2),
localtime(3), localtime_r(2), mktime(3), strftime(3), time(3), tzset(3), utime(3).
STANDARDS CONFORMANCE
Interfaces documented on this reference page conform to the following industry standards:
• IEEE Std 1003.1c-1996, POSIX System Application Program Interface.
The use of the header file spthread.h is an HP exception to the POSIX standard.
1−8 Hewlett-Packard Company 527186-005