HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)
g
gettimeofday(2) gettimeofday(2)
NAME
gettimeofday - get the date and time
SYNOPSIS
#include <sys/time.h>
int gettimeofday(struct timeval *tp, void *tzp);
DESCRIPTION
The gettimeofday()
function obtains the current time, expressed as seconds and microseconds since
00:00 Coordinated Universal Time (UTC), January 1, 1970, and stores it in the
timeval structure
pointed to by tp. The resolution of the system clock is unspecified.
If tzp is not a null pointer, the application is not a UNIX-conforming application. See the HP-UX EXTEN-
SIONS section for treatment of a non-null pointer for the tzp argument.
RETURN VALUE
The
gettimeofday()
function returns 0 and no value is reserved to indicate an error. See the HP-UX
EXTENSIONS section for function return values under HP-UX.
ERRORS
No errors are defined. See the HP-UX EXTENSIONS section for error values under HP-UX.
SEE ALSO
ctime(3C), date(1), ftime(2), stime(2), time(2), <sys/time.h>.
CHANGE HISTORY
First released in Issue 4, Version 2.
HP-UX 11i Version 1: September 2005 − 1 − Hewlett-Packard Company Section 2−−121