TIME(3)

NAME
time - get time of day

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

DESCRIPTION
The time() function returns the number of seconds elapsed since Jan 1 1970 00:00:00 UTC. This value is also written to now unless now is NULL.

RETURN VALUES
The time() function is always successful, and no return value is reserved to indicate an error.

SEE ALSO
clock_gettime(2), gettimeofday(2), ctime(3)

STANDARDS
The time() function conforms to p1003.1-2008.

HISTORY
A time() system call first appeared in AT&T UNIX. That version counted time in sixtieths of a second with a 32-bit return value, ensuring an integer overflow crisis every 2.26 years. In AT&T UNIX the granularity of the return value was reduced to whole seconds, delaying the aforementioned crisis until 2038. In 4.1cBSD the function was moved out of the kernel into the C standard library and reimplemented with gettimeofday(2).