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

RETURN VALUE

36       This function always returns 0.  (POSIX.1-2001 specifies, and some sys‐
37       tems document, a -1 error return.)
38

CONFORMING TO

40       4.2BSD,  POSIX.1-2001.   POSIX.1-2008  removes  the  specification   of
41       ftime().
42
43       This  function is obsolete.  Don't use it.  If the time in seconds suf‐
44       fices,  time(2)  can  be  used;  gettimeofday(2)  gives   microseconds;
45       clock_gettime(2) gives nanoseconds but is not as widely available.
46

BUGS

48       Under  libc4  and  libc5  the  millitm  field is meaningful.  But early
49       glibc2 is buggy and returns 0 there; glibc 2.1.1 is correct again.
50

SEE ALSO

52       gettimeofday(2), time(2)
53

COLOPHON

55       This page is part of release 3.53 of the Linux  man-pages  project.   A
56       description  of  the project, and information about reporting bugs, can
57       be found at http://www.kernel.org/doc/man-pages/.
58
59
60
61GNU                               2010-02-25                          FTIME(3)
Impressum