1TIME(2) Linux Programmer's Manual TIME(2)
2
3
4
6 time - get time in seconds
7
9 #include <time.h>
10
11 time_t time(time_t *t);
12
14 time() returns the time as the number of seconds since the Epoch,
15 1970-01-01 00:00:00 +0000 (UTC).
16
17 If t is non-NULL, the return value is also stored in the memory pointed
18 to by t.
19
21 On success, the value of time in seconds since the Epoch is returned.
22 On error, ((time_t) -1) is returned, and errno is set appropriately.
23
25 EFAULT t points outside your accessible address space.
26
28 SVr4, 4.3BSD, C89, C99, POSIX.1-2001. POSIX does not specify any error
29 conditions.
30
32 POSIX.1 defines seconds since the Epoch using a formula that approxi‐
33 mates the number of seconds between a specified time and the Epoch.
34 This formula takes account of the facts that all years that are evenly
35 divisible by 4 are leap years, but years that are evenly divisible by
36 100 are not leap years unless they are also evenly divisible by 400, in
37 which case they are leap years. This value is not the same as the
38 actual number of seconds between the time and the Epoch, because of
39 leap seconds and because system clocks are not required to be synchro‐
40 nized to a standard reference. The intention is that the interpreta‐
41 tion of seconds since the Epoch values be consistent; see POSIX.1-2008
42 Rationale A.4.15 for further rationale.
43
45 date(1), gettimeofday(2), ctime(3), ftime(3), time(7)
46
48 This page is part of release 3.53 of the Linux man-pages project. A
49 description of the project, and information about reporting bugs, can
50 be found at http://www.kernel.org/doc/man-pages/.
51
52
53
54Linux 2011-09-09 TIME(2)