gettimeofday

Returns the date and time, expressed in seconds and microseconds.

Library:LibC
Classification:BSD
Service:Time

Syntax

  #include <sys/time.h> 
   
  int gettimeofday (
     struct timeval    *tp,
     struct timezone   *tpz);
  

Parameters

tp

(OUT) Points to a timeval structure that returns the seconds and microseconds since January 1, 1970.

tpz

(OUT) Points to a structure containing time zone information.

Return Values

Returns 0. No error conditions have been defined.

Remarks

The current time is expressed in seconds and microseconds since midnight UTC (January 1, 1970).

See Also

settimeofday