]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/time.2
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
[thirdparty/man-pages.git] / man2 / time.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified Sat Jul 24 14:13:40 1993 by Rik Faith <faith@cs.unc.edu>
27 .\" Additions by Joseph S. Myers <jsm28@cam.ac.uk>, 970909
28 .\"
29 .TH TIME 2 1997-09-09 "Linux 2.0.30" "Linux Programmer's Manual"
30 .SH NAME
31 time \- get time in seconds
32 .SH SYNOPSIS
33 .B #include <time.h>
34 .sp
35 .BI "time_t time(time_t *" t );
36 .SH DESCRIPTION
37 \fBtime\fP() returns the time since the Epoch
38 (00:00:00 UTC, January 1, 1970), measured in seconds.
39
40 If
41 .I t
42 is non-NULL,
43 the return value is also stored in the memory pointed to by
44 .IR t .
45 .SH "RETURN VALUE"
46 On success, the value of time in seconds since the Epoch is returned.
47 On error, ((time_t)\-1) is returned, and \fIerrno\fP is set
48 appropriately.
49 .SH ERRORS
50 .TP
51 .B EFAULT
52 .I t
53 points outside your accessible address space.
54 .SH NOTES
55 POSIX.1 defines
56 .I seconds since the Epoch
57 as a value to be interpreted as the number of seconds between a
58 specified time and the Epoch, according to a formula for conversion
59 from UTC equivalent to conversion on the naive basis that leap
60 seconds are ignored and all years divisible by 4 are leap years.
61 This value is not the same as the actual number of seconds between the time
62 and the Epoch, because of leap seconds and because clocks are not
63 required to be synchronised to a standard reference.
64 The intention is
65 that the interpretation of seconds since the Epoch values be
66 consistent; see POSIX.1 Annex B 2.2.2 for further rationale.
67 .SH "CONFORMING TO"
68 SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
69 .\" .br
70 .\" Under 4.3BSD, this call is obsoleted by
71 .\" .BR gettimeofday (2).
72 POSIX does not specify any error conditions.
73 .SH "SEE ALSO"
74 .BR date (1),
75 .BR gettimeofday (2),
76 .BR ctime (3),
77 .BR ftime (3),
78 .BR time (7)