gettimeofday

Gets date and time.

Format

#include  <time.h>

int gettimeofday  (struct timeval *tp, void *tpz);

Arguments

tp
Pointer to a timeval structure, defined in the <time.h> header file.
tpz
A NULL pointer. If this argument is not a NULL pointer, the behavior is unspecified.

Description

This function gets the current time (expressed as seconds and microseconds) since 00::00 Coordinated Universal Time, January 1, 1970. The current time is stored in the timeval structure pointed to by the tp argument.

The tzp argument is intended to hold time-zone information set by the kernel. However, because the OpenVMS kernel does not set time-zone information, the tzp argument should be NULL. If it is not NULL, it is ignored. This function is supported for compatibility with BSD programs.

Return Values
Indicates success. 
-1  An error occurred. errno is set to indicate the error. 


Previous Page | Next Page | Table of Contents | Index