|
Packit |
7cfc04 |
.\" Copyright (c) 1993 Michael Haardt
|
|
Packit |
7cfc04 |
.\" (michael@moria.de)
|
|
Packit |
7cfc04 |
.\" Fri Apr 2 11:32:09 MET DST 1993
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
|
|
Packit |
7cfc04 |
.\" This is free documentation; you can redistribute it and/or
|
|
Packit |
7cfc04 |
.\" modify it under the terms of the GNU General Public License as
|
|
Packit |
7cfc04 |
.\" published by the Free Software Foundation; either version 2 of
|
|
Packit |
7cfc04 |
.\" the License, or (at your option) any later version.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" The GNU General Public License's references to "object code"
|
|
Packit |
7cfc04 |
.\" and "executables" are to be interpreted as the output of any
|
|
Packit |
7cfc04 |
.\" document formatting or typesetting system, including
|
|
Packit |
7cfc04 |
.\" intermediate and printed output.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" This manual is distributed in the hope that it will be useful,
|
|
Packit |
7cfc04 |
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
7cfc04 |
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
7cfc04 |
.\" GNU General Public License for more details.
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" You should have received a copy of the GNU General Public
|
|
Packit |
7cfc04 |
.\" License along with this manual; if not, see
|
|
Packit |
7cfc04 |
.\" <http://www.gnu.org/licenses/>.
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_END
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" Modified Sat Jul 24 14:23:14 1993 by Rik Faith (faith@cs.unc.edu)
|
|
Packit |
7cfc04 |
.\" Modified Sun Oct 18 17:31:43 1998 by Andries Brouwer (aeb@cwi.nl)
|
|
Packit |
7cfc04 |
.\" 2008-06-23, mtk, minor rewrites, added some details
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.TH FTIME 3 2017-09-15 "GNU" "Linux Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
ftime \- return date and time
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.B "#include <sys/timeb.h>"
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.BI "int ftime(struct timeb *" tp );
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
This function returns the current time as seconds and milliseconds
|
|
Packit |
7cfc04 |
since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
|
|
Packit |
7cfc04 |
The time is returned in
|
|
Packit |
7cfc04 |
.IR tp ,
|
|
Packit |
7cfc04 |
which is declared as follows:
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.in +4n
|
|
Packit |
7cfc04 |
.EX
|
|
Packit |
7cfc04 |
struct timeb {
|
|
Packit |
7cfc04 |
time_t time;
|
|
Packit |
7cfc04 |
unsigned short millitm;
|
|
Packit |
7cfc04 |
short timezone;
|
|
Packit |
7cfc04 |
short dstflag;
|
|
Packit |
7cfc04 |
};
|
|
Packit |
7cfc04 |
.EE
|
|
Packit |
7cfc04 |
.in
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
Here \fItime\fP is the number of seconds since the Epoch,
|
|
Packit |
7cfc04 |
and \fImillitm\fP is the number of milliseconds since \fItime\fP
|
|
Packit |
7cfc04 |
seconds since the Epoch.
|
|
Packit |
7cfc04 |
The \fItimezone\fP field is the local timezone measured in minutes
|
|
Packit |
7cfc04 |
of time west of Greenwich (with a negative value indicating minutes
|
|
Packit |
7cfc04 |
east of Greenwich).
|
|
Packit |
7cfc04 |
The \fIdstflag\fP field
|
|
Packit |
7cfc04 |
is a flag that, if nonzero, indicates that Daylight Saving time
|
|
Packit |
7cfc04 |
applies locally during the appropriate part of the year.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
POSIX.1-2001 says that the contents of the \fItimezone\fP and \fIdstflag\fP
|
|
Packit |
7cfc04 |
fields are unspecified; avoid relying on them.
|
|
Packit |
7cfc04 |
.SH RETURN VALUE
|
|
Packit |
7cfc04 |
This function always returns 0.
|
|
Packit |
7cfc04 |
(POSIX.1-2001 specifies, and some systems document, a \-1 error return.)
|
|
Packit |
7cfc04 |
.SH ATTRIBUTES
|
|
Packit |
7cfc04 |
For an explanation of the terms used in this section, see
|
|
Packit |
7cfc04 |
.BR attributes (7).
|
|
Packit |
7cfc04 |
.TS
|
|
Packit |
7cfc04 |
allbox;
|
|
Packit |
7cfc04 |
lb lb lb
|
|
Packit |
7cfc04 |
l l l.
|
|
Packit |
7cfc04 |
Interface Attribute Value
|
|
Packit |
7cfc04 |
T{
|
|
Packit |
7cfc04 |
.BR ftime ()
|
|
Packit |
7cfc04 |
T} Thread safety MT-Safe
|
|
Packit |
7cfc04 |
.TE
|
|
Packit |
7cfc04 |
.SH CONFORMING TO
|
|
Packit |
7cfc04 |
4.2BSD, POSIX.1-2001.
|
|
Packit |
7cfc04 |
POSIX.1-2008 removes the specification of
|
|
Packit |
7cfc04 |
.BR ftime ().
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
This function is obsolete.
|
|
Packit |
7cfc04 |
Don't use it.
|
|
Packit |
7cfc04 |
If the time in seconds
|
|
Packit |
7cfc04 |
suffices,
|
|
Packit |
7cfc04 |
.BR time (2)
|
|
Packit |
7cfc04 |
can be used;
|
|
Packit |
7cfc04 |
.BR gettimeofday (2)
|
|
Packit |
7cfc04 |
gives microseconds;
|
|
Packit |
7cfc04 |
.BR clock_gettime (2)
|
|
Packit |
7cfc04 |
gives nanoseconds but is not as widely available.
|
|
Packit |
7cfc04 |
.SH BUGS
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
Early glibc2 is buggy and returns 0 in the
|
|
Packit |
7cfc04 |
.I millitm
|
|
Packit |
7cfc04 |
field;
|
|
Packit |
7cfc04 |
glibc 2.1.1 is correct again.
|
|
Packit |
7cfc04 |
.\" .SH HISTORY
|
|
Packit |
7cfc04 |
.\" The
|
|
Packit |
7cfc04 |
.\" .BR ftime ()
|
|
Packit |
7cfc04 |
.\" function appeared in 4.2BSD.
|
|
Packit |
7cfc04 |
.SH SEE ALSO
|
|
Packit |
7cfc04 |
.BR gettimeofday (2),
|
|
Packit |
7cfc04 |
.BR time (2)
|
|
Packit |
7cfc04 |
.SH COLOPHON
|
|
Packit |
7cfc04 |
This page is part of release 4.15 of the Linux
|
|
Packit |
7cfc04 |
.I man-pages
|
|
Packit |
7cfc04 |
project.
|
|
Packit |
7cfc04 |
A description of the project,
|
|
Packit |
7cfc04 |
information about reporting bugs,
|
|
Packit |
7cfc04 |
and the latest version of this page,
|
|
Packit |
7cfc04 |
can be found at
|
|
Packit |
7cfc04 |
\%https://www.kernel.org/doc/man\-pages/.
|