Next: __tz_lock
, __tz_unlock
—lock time zone global variables, Previous: strftime
, strftime_l
—convert date and time to a formatted string, Up: Time Functions (time.h) [Contents][Index]
time
—get current calendar time (as single number)Synopsis
#include <time.h> time_t time(time_t *t);
Description
time
looks up the best available representation of the current
time and returns it, encoded as a time_t
. It stores the same
value at t unless the argument is NULL
.
Returns
A -1
result means the current time is not available; otherwise the
result represents the current time.
Portability
ANSI C requires time
.
Supporting OS subroutine required: Some implementations require
gettimeofday
.