Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
gettimeofday(2) OSS System Calls Reference Manual
NAME
gettimeofday - Gets date and time
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossksrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zosskdll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yosskdll
SYNOPSIS
#include <sys/time.h>
int gettimeofday(
struct timeval *tp,
struct timezone *tzp);
PARAMETERS
tp Points to a timeval structure, defined in the sys/time.h file. The timeval struc-
ture contains the current time when the call is completed. If a null pointer is
specified, the current time is not returned. If an invalid writable address is
specified, a SIGSEGV signal is generated.
tzp Points to a timezone structure, defined in the sys/time.h file. The timezone
structure contains the current time zone when the call is completed. If a null
pointer is specified, the current time zone is not returned. If an invalid writable
address is specified, a SIGSEGV signal is generated.
DESCRIPTION
The gettimeofday() function gets the system values for the current time and time zone. The time
is expressed in seconds and microseconds since midnight (0 hour), January 1, 1970.
The timeval structure contains the following fields:
tv_sec The number of whole seconds of elapsed time.
tv_usec The number of additional microseconds of elapsed time.
The timezone structure contains the following fields:
tz_minuteswest
The local time zone, measured in minutes of time westward from Coordinated
Universal Time (Greenwich, England).
tz_dsttime A value that indicates which daylight-saving time correction applies locally dur-
ing the appropriate part of the year.
This value is always set to 0 (zero) upon successful completion, because the
information required to return an accurate nonzero value is not available.
Use From the Guardian Environment
This function can be used in the Guardian environment.
NOTES
The gettimeofday() function is supported for compatibility with BSD programs. This function
provides a process-local time-zone parameter in addition to the systemwide time and date.
3−94 Hewlett-Packard Company 527186-023