Debian Codegraph @

upstream/debian-trixie/man3/ftime.3

raw
1 '\" t
2 .\" Copyright (c) 1993 Michael Haardt
3 .\" ([email protected])
4 .\" Fri Apr 2 11:32:09 MET DST 1993
5 .\"
6 .\" SPDX-License-Identifier: GPL-2.0-or-later
7 .\"
8 .\" Modified Sat Jul 24 14:23:14 1993 by Rik Faith ([email protected])
9 .\" Modified Sun Oct 18 17:31:43 1998 by Andries Brouwer ([email protected])
10 .\" 2008-06-23, mtk, minor rewrites, added some details
11 .\"
12 .TH ftime 3 2024-05-02 "Linux man-pages 6.9.1"
13 .SH NAME
14 ftime \- return date and time
15 .SH LIBRARY
16 Standard C library
17 .RI ( libc ", " \-lc )
18 .SH SYNOPSIS
19 .nf
20 .B "#include <sys/timeb.h>"
21 .P
22 .BI "int ftime(struct timeb *" tp );
23 .fi
24 .SH DESCRIPTION
25 .BR NOTE :
26 This function is no longer provided by the GNU C library.
27 Use
28 .BR clock_gettime (2)
29 instead.
30 .P
31 This function returns the current time as seconds and milliseconds
32 since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
33 The time is returned in
34 .IR tp ,
35 which is declared as follows:
36 .P
37 .in +4n
38 .EX
39 struct timeb {
40 time_t time;
41 unsigned short millitm;
42 short timezone;
43 short dstflag;
44 };
45 .EE
46 .in
47 .P
48 Here \fItime\fP is the number of seconds since the Epoch,
49 and \fImillitm\fP is the number of milliseconds since \fItime\fP
50 seconds since the Epoch.
51 The \fItimezone\fP field is the local timezone measured in minutes
52 of time west of Greenwich (with a negative value indicating minutes
53 east of Greenwich).
54 The \fIdstflag\fP field
55 is a flag that, if nonzero, indicates that Daylight Saving time
56 applies locally during the appropriate part of the year.
57 .P
58 POSIX.1-2001 says that the contents of the \fItimezone\fP and \fIdstflag\fP
59 fields are unspecified; avoid relying on them.
60 .SH RETURN VALUE
61 This function always returns 0.
62 (POSIX.1-2001 specifies, and some systems document, a \-1 error return.)
63 .SH ATTRIBUTES
64 For an explanation of the terms used in this section, see
65 .BR attributes (7).
66 .TS
67 allbox;
68 lbx lb lb
69 l l l.
70 Interface Attribute Value
71 T{
72 .na
73 .nh
74 .BR ftime ()
75 T} Thread safety MT-Safe
76 .TE
77 .SH STANDARDS
78 None.
79 .SH HISTORY
80 Removed in glibc 2.33.
81 4.2BSD, POSIX.1-2001.
82 Removed in POSIX.1-2008.
83 .P
84 This function is obsolete.
85 Don't use it.
86 If the time in seconds
87 suffices,
88 .BR time (2)
89 can be used;
90 .BR gettimeofday (2)
91 gives microseconds;
92 .BR clock_gettime (2)
93 gives nanoseconds but is not as widely available.
94 .SH BUGS
95 Early glibc2 is buggy and returns 0 in the
96 .I millitm
97 field;
98 glibc 2.1.1 is correct again.
99 .\" .SH HISTORY
100 .\" The
101 .\" .BR ftime ()
102 .\" function appeared in 4.2BSD.
103 .SH SEE ALSO
104 .BR gettimeofday (2),
105 .BR time (2)