CINXE.COM

ftime

<html> <head> <title>ftime</title> <META NAME="KEYWORDS" CONTENT="ftime"> </head> <body BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#0000ff" ALINK="#0000ff" TEXT="#000000"> <center> <h1><b>ftime</b></h1></center> <PRE> <STRONG><A HREF="/man3/FTIME">FTIME(3)</A></STRONG> Linux Programmer's Manual <STRONG><A HREF="/man3/FTIME">FTIME(3)</A></STRONG> NAME ftime - return date and time SYNOPSIS #include &lt;sys/timeb.h&gt; int ftime(struct timeb *tp); DESCRIPTION NOTE: This function is deprecated, and will be removed in a future ver- sion of the GNU C library. Use <STRONG><A HREF="/man2/clock_gettime">clock_gettime(2)</A></STRONG> instead. This function returns the current time as seconds and milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). The time is returned in tp, which is declared as follows: struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; Here time is the number of seconds since the Epoch, and millitm is the number of milliseconds since time seconds since the Epoch. The time- zone field is the local timezone measured in minutes of time west of Greenwich (with a negative value indicating minutes east of Greenwich). The dstflag field is a flag that, if nonzero, indicates that Daylight Saving time applies locally during the appropriate part of the year. POSIX.1-2001 says that the contents of the timezone and dstflag fields are unspecified; avoid relying on them. RETURN VALUE This function always returns 0. (POSIX.1-2001 specifies, and some sys- tems document, a -1 error return.) ATTRIBUTES For an explanation of the terms used in this section, see at- <STRONG><A HREF="/man7/tributes">tributes(7)</A></STRONG>. +----------+---------------+---------+ |Interface | Attribute | Value | +----------+---------------+---------+ |ftime() | Thread safety | MT-Safe | +----------+---------------+---------+ CONFORMING TO 4.2BSD, POSIX.1-2001. POSIX.1-2008 removes the specification of ftime(). This function is obsolete. Don't use it. If the time in seconds suf- fices, <STRONG><A HREF="/man2/time">time(2)</A></STRONG> can be used; <STRONG><A HREF="/man2/gettimeofday">gettimeofday(2)</A></STRONG> gives microseconds; <STRONG><A HREF="/man2/clock_gettime">clock_gettime(2)</A></STRONG> gives nanoseconds but is not as widely available. BUGS Early glibc2 is buggy and returns 0 in the millitm field; glibc 2.1.1 is correct again. SEE ALSO <STRONG><A HREF="/man2/gettimeofday">gettimeofday(2)</A></STRONG>, <STRONG><A HREF="/man2/time">time(2)</A></STRONG> COLOPHON This page is part of release 5.05 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU 2020-02-09 <STRONG><A HREF="/man3/FTIME">FTIME(3)</A></STRONG></PRE> <center> <h6>Man Pages Copyright Respective Owners. Site Copyright (C) 1994 - 2025 <a href="http://www.he.net">Hurricane Electric</a>. All Rights Reserved.</h6></center> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10