time

Returns the time in seconds since the epoch.

Library:LibC
Classification:ANSI
Service:Time

Syntax

  #include <time.h> 
   
  time_t time (
     time_t  *calendar);
  

Parameters

calendar

(OUT) Points to the object into which the encoded calendar time has been placed.

Return Values

If successful, returns the current time. Otherwise, returns -1.

Remarks

The time represents the time in seconds since January 1, 1970 00:00:00 (Universal Coordinated Time), which is the seconds since the epoch. If the calendar parameter is not NULL, the current calendar time is also stored in the object pointed to by the calendar parameter.

See Also

clock