1TIME(2) System Calls Manual TIME(2)
2
3
4
6 time, ftime - get date and time
7
9 long time(0)
10
11 long time(tloc)
12 long *tloc;
13
14 #include <sys/types.h>
15 #include <sys/timeb.h>
16 ftime(tp)
17 struct timeb *tp;
18
20 Time returns the time since 00:00:00 GMT, Jan. 1, 1970, measured in
21 seconds.
22
23 If tloc is nonnull, the return value is also stored in the place to
24 which tloc points.
25
26 The ftime entry fills in a structure pointed to by its argument, as
27 defined by <sys/timeb.h>:
28
29 /* Copyright (C) 1994, 1995, 1996, 1999 Free Software Foundation, Inc.
30 This file is part of the GNU C Library.
31
32 The GNU C Library is free software; you can redistribute it and/or
33 modify it under the terms of the GNU Lesser General Public
34 License as published by the Free Software Foundation; either
35 version 2.1 of the License, or (at your option) any later version.
36
37 The GNU C Library is distributed in the hope that it will be useful,
38 but WITHOUT ANY WARRANTY; without even the implied warranty of
39 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
40 Lesser General Public License for more details.
41
42 You should have received a copy of the GNU Lesser General Public
43 License along with the GNU C Library; if not, see
44 <http://www.gnu.org/licenses/>. */
45
46 #ifndef _SYS_TIMEB_H
47 #define _SYS_TIMEB_H1
48
49 #include <features.h>
50
51 #define __need_time_t
52 #include <time.h>
53
54
55 __BEGIN_DECLS
56
57 /* Structure returned by the `ftime' function. */
58
59 struct timeb
60 {
61 time_t time;/* Seconds since epoch, as from `time'. */
62 unsigned short int millitm;/* Additional milliseconds. */
63 short int timezone;/* Minutes west of GMT. */
64 short int dstflag;/* Nonzero if Daylight Savings Time used. */
65 };
66
67 /* Fill in TIMEBUF with information about the current time. */
68
69 extern int ftime (struct timeb *__timebuf);
70
71 __END_DECLS
72
73 #endif /* sys/timeb.h */
74
75 The structure contains the time since the epoch in seconds, up to 1000
76 milliseconds of more-precise interval, the local timezone (measured in
77 minutes of time westward from Greenwich), and a flag that, if nonzero,
78 indicates that Daylight Saving time applies locally during the appro‐
79 priate part of the year.
80
82 date(1), stime(2), ctime(3)
83
85 (ftime = 35.)
86 sys ftime; bufptr
87
88 (time = 13.; obsolete call)
89 sys time
90 (time since 1970 in r0-r1)
91
92
93
94 TIME(2)