time

Returns the current calendar time

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Time/Date Manipulation

Syntax

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

Parameters

timer
(OUT) Points to the object into which the encoded calendar time (same as return value of time) has been placed.

Return Values

Returns the current calendar time encoded into type time_t. On error, returns -1 cast as type (time_t). To test for an error condition, compare the return value to (time_t) -1.

Remarks

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

See Also

clock