TIME(S) XENIX System V TIME(S)
Name
time, ftime - Gets time and date.
Syntax
long time ((long *) 0)
long time (tloc)
long *tloc;
#include <sys/types.h>
#include <sys/timeb.h>
void ftime(tp)
struct timeb *tp;
Description
time returns the current system time in seconds since
00:00:00 GMT, January 1, 1970.
If tloc (taken as an integer) is nonzero, the return value
is also stored in the location to which tloc points.
ftime returns the time in a structure (see below under
Return Value.)
time will fail if tloc points to an illegal address.
[EFAULT] Likewise, ftime will fail if tp points to an
illegal address. [EFAULT]
Return Value
Upon successful completion, time returns the value of time.
Otherwise, a value of -1 is returned and errno is set to
indicate the error.
The ftime entry fills in a structure pointed to by its
argument, as defined by <sys/timeb.h>:
/*
* Structure returned by ftime system call
*/
struct timeb {
long time;
unsigned short millitm;
short timezone;
short dstflag;
};
Note that the timezone value is a system default timezone
and not the value of the TZ environment variable.
The structure contains the time since the epoch in seconds,
up to 1000 milliseconds of more-precise interval, the local
Page 1 (printed 8/7/87)
TIME(S) XENIX System V TIME(S)
time zone (measured in minutes of time westward from
Greenwich), and a flag that, if nonzero, indicates that
Daylight Saving time applies locally during the appropriate
part of the year.
See Also
date(C), stime(S), ctime(S)
Notes
Since ftime does not return the correct timezone value, its
use is not recommended. See ctime(S) for accurate use of
the TZ variable. This routine must be linked using the
linker option -lx.
Page 2 (printed 8/7/87)