Manual page for gettimeofday(3C)
gettimeofday, settimeofday - get or set the date and time
int gettimeofday(struct timeval *tp, void * );
int settimeofday(struct timeval *tp, void * );
sets the system's notion of the current time.
The current time is expressed in elapsed seconds and microseconds
since 00:00 Universal Coordinated Time, January 1, 1970.
The resolution of the system clock is hardware dependent;
the time may be updated continuously
or in clock ticks.
points to a
structure, which includes the following members:
long tv_sec; /* seconds since Jan. 1, 1970 */
long tv_usec; /* and microseconds */
is a null pointer, the current time information is not returned or set.
environment variable holds time zone information.
The second argument to
should be a pointer to
Only the privileged user may set the time of day.
return value indicates that an error occurred and
has been set.
The following error codes may be set in
specifies an invalid time.
A user other than the privileged user attempted to set the time or time
The implementation of
If the time needs to be set with better than one second accuracy, call
for the seconds
for finer accuracy.
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97