1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (c) 1993 Michael Haardt
5 .\" Fri Apr 2 11:32:09 MET DST 1993
7 .\" This is free documentation; you can redistribute it and/or
8 .\" modify it under the terms of the GNU General Public License as
9 .\" published by the Free Software Foundation; either version 2 of
10 .\" the License, or (at your option) any later version.
12 .\" The GNU General Public License's references to "object code"
13 .\" and "executables" are to be interpreted as the output of any
14 .\" document formatting or typesetting system, including
15 .\" intermediate and printed output.
17 .\" This manual is distributed in the hope that it will be useful,
18 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 .\" GNU General Public License for more details.
22 .\" You should have received a copy of the GNU General Public
23 .\" License along with this manual; if not, write to the Free
24 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
27 .\" Modified Sat Jul 24 14:23:14 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified Sun Oct 18 17:31:43 1998 by Andries Brouwer (aeb@cwi.nl)
29 .\" 2008-06-23, mtk, minor rewrites, added some details
31 .TH FTIME 3 2009-03-15 "GNU" "Linux Programmer's Manual"
33 ftime \- return date and time
35 .B "#include <sys/timeb.h>"
37 .BI "int ftime(struct timeb *" tp );
39 This function returns the current time, in seconds and milliseconds
40 since the Epoch (00:00:00 UTC, 1 January 1970).
41 The time is returned in
43 which is declared as follows:
49 unsigned short millitm;
56 Here \fItime\fP is the number of seconds since the Epoch,
57 and \fImillitm\fP is the number of milliseconds since \fItime\fP
58 seconds since the Epoch.
59 The \fItimezone\fP field is the local timezone measured in minutes
60 of time west of Greenwich (with a negative value indicating minutes
62 The \fIdstflag\fP field
63 is a flag that, if nonzero, indicates that Daylight Saving time
64 applies locally during the appropriate part of the year.
66 POSIX.1-2001 says that the contents of the \fItimezone\fP and \fIdstflag\fP
67 fields are unspecified; avoid relying on them.
69 This function always returns 0.
70 (POSIX.1-2001 specifies, and some systems document, a \-1 error return.)
73 POSIX.1-2008 removes the specification of
76 This function is obsolete.
78 If the time in seconds
85 gives nanoseconds but is not as widely available.
88 Under libc4 and libc5 the \fImillitm\fP field is meaningful.
89 But early glibc2 is buggy and returns 0 there;
90 glibc 2.1.1 is correct again.
94 .\" function appeared in 4.2BSD.