The system's notion of the current Greenwich time is obtained with the gettimeofday() call, and set with the settimeofday() call. The current time is expressed
in elapsed seconds and microseconds since 00:00 GMT, January 1, 1970 (zero hour). The resolution of the system clock is hardware dependent; the time may be updated continuously,
or in clock ticks.
|
long tv_sec; /* seconds since Jan. 1, 1970 */
long tv_usec; /* and microseconds */
|
tp points to a timeval structure, which includes the following members:
If tp is a NULL pointer, the current time information is not returned or set.
tzp is an obsolete pointer formerly used to get and set timezone information. tzp is now ignored. Timezone information is now handled using the TZ environment variable; see TIMEZONE(4).
Only the privileged user may set the time of day.
|