1FTIME(3)                   Linux Programmer's Manual                  FTIME(3)
2
3
4

NAME

6       ftime - return date and time
7

SYNOPSIS

9       #include <sys/timeb.h>
10
11       int ftime(struct timeb *tp);
12

DESCRIPTION

14       NOTE:  This  function  is no longer provided by the GNU C library.  Use
15       clock_gettime(2) instead.
16
17       This function returns the current  time  as  seconds  and  milliseconds
18       since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).  The time is returned
19       in tp, which is declared as follows:
20
21           struct timeb {
22               time_t         time;
23               unsigned short millitm;
24               short          timezone;
25               short          dstflag;
26           };
27
28       Here time is the number of seconds since the Epoch, and millitm is  the
29       number  of  milliseconds since time seconds since the Epoch.  The time‐
30       zone field is the local timezone measured in minutes of  time  west  of
31       Greenwich (with a negative value indicating minutes east of Greenwich).
32       The dstflag field is a flag that, if nonzero, indicates  that  Daylight
33       Saving time applies locally during the appropriate part of the year.
34
35       POSIX.1-2001  says that the contents of the timezone and dstflag fields
36       are unspecified; avoid relying on them.
37

RETURN VALUE

39       This function always returns 0.  (POSIX.1-2001 specifies, and some sys‐
40       tems document, a -1 error return.)
41

VERSIONS

43       Starting  with  glibc  2.33, the ftime() function and the <sys/timeb.h>
44       header have been removed.  To support old binaries, glibc continues  to
45       provide  a  compatibility  symbol for applications linked against glibc
46       2.32 and earlier.
47

ATTRIBUTES

49       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
50       tributes(7).
51
52       ┌────────────────────────────────────────────┬───────────────┬─────────┐
53Interface                                   Attribute     Value   
54       ├────────────────────────────────────────────┼───────────────┼─────────┤
55ftime()                                     │ Thread safety │ MT-Safe │
56       └────────────────────────────────────────────┴───────────────┴─────────┘
57

CONFORMING TO

59       4.2BSD,   POSIX.1-2001.   POSIX.1-2008  removes  the  specification  of
60       ftime().
61
62       This function is obsolete.  Don't use it.  If the time in seconds  suf‐
63       fices,   time(2)  can  be  used;  gettimeofday(2)  gives  microseconds;
64       clock_gettime(2) gives nanoseconds but is not as widely available.
65

BUGS

67       Early glibc2 is buggy and returns 0 in the millitm field;  glibc  2.1.1
68       is correct again.
69

SEE ALSO

71       gettimeofday(2), time(2)
72

COLOPHON

74       This  page  is  part of release 5.13 of the Linux man-pages project.  A
75       description of the project, information about reporting bugs,  and  the
76       latest     version     of     this    page,    can    be    found    at
77       https://www.kernel.org/doc/man-pages/.
78
79
80
81GNU                               2021-03-22                          FTIME(3)
Impressum