]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" Copyright (c) 1993 Michael Haardt | |
4 | .\" (michael@moria.de) | |
5 | .\" Fri Apr 2 11:32:09 MET DST 1993 | |
6 | .\" | |
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. | |
11 | .\" | |
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. | |
16 | .\" | |
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. | |
21 | .\" | |
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, | |
25 | .\" USA. | |
26 | .\" | |
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 | .\" | |
30 | .TH FTIME 3 2001-12-14 "Linux" "Linux Programmer's Manual" | |
31 | .SH NAME | |
32 | ftime \- return date and time | |
33 | .SH SYNOPSIS | |
34 | .B "#include <sys/timeb.h>" | |
35 | .sp | |
36 | .BI "int ftime(struct timeb *" tp ); | |
37 | .SH DESCRIPTION | |
38 | Return current date and time in | |
39 | .IR tp , | |
40 | which is declared as follows: | |
41 | .sp | |
42 | .in +1i | |
43 | .nf | |
44 | struct timeb { | |
45 | time_t time; | |
46 | unsigned short millitm; | |
47 | short timezone; | |
48 | short dstflag; | |
49 | }; | |
50 | .fi | |
51 | .in -1i | |
52 | .LP | |
53 | Here \fItime\fP is the number of seconds since the epoch, | |
54 | \fImillitm\fP is the number of milliseconds since \fItime\fP | |
55 | seconds since the epoch, \fItimezone\fP is the local time zone | |
56 | measured in minutes of time west of Greenwich, and \fIdstflag\fP | |
f59a3f19 | 57 | is a flag that, if non-zero, indicates that Daylight Saving time |
fea681da MK |
58 | applies locally during the appropriate part of the year. |
59 | .LP | |
60 | These days the contents of the \fItimezone\fP and \fIdstflag\fP | |
61 | fields are undefined. | |
62 | .SH "RETURN VALUE" | |
63 | This function always returns 0. | |
64 | .SH BUGS | |
65 | This function is obsolete. Don't use it. If the time in seconds | |
66 | suffices, | |
67 | .BR time (2) | |
68 | can be used; | |
69 | .BR gettimeofday (2) | |
70 | gives microseconds; | |
71 | .BR clock_gettime (3) | |
72 | gives nanoseconds but is not yet widely available. | |
73 | .LP | |
74 | Under libc4 and libc5 the \fImillitm\fP field is meaningful. | |
75 | But early glibc2 is buggy and returns 0 there; | |
76 | glibc 2.1.1 is correct again. | |
77 | .SH HISTORY | |
78 | The | |
79 | .B ftime() | |
80 | function appeared in 4.2BSD. | |
81 | .SH "CONFORMING TO" | |
82 | BSD 4.2, POSIX 1003.1-2001. | |
83 | .SH "SEE ALSO" | |
84 | .BR gettimeofday (2), | |
85 | .BR time (2) |