Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > F


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


ftime — get date and time more precisely


#include <sys/timeb.h>

int ftime(struct timeb *tp);


This facility is provided for backwards compatibility with Version 7 systems. Either time() or gettimeofday() should be used in new programs.


ftime() fills in a structure pointed to by its argument, as defined by <sys/timeb.h>:

/* * Structure returned by ftime system call */ struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; };

The structure contains the time in seconds since 00:00:00 UTC (Coordinated Universal Time), January 1, 1970, up to 1000 milliseconds of more-precise interval, the local timezone (measured in minutes of time westward from UTC), and a flag that, if nonzero, indicates that Daylight Saving time applies locally during the appropriate part of the year. Consult gettimeofday(2) for more details on the meaning of the timezone field.

ftime() can fail for exactly the same reasons as gettimeofday(2).


The millisecond value usually has a granularity greater than one due to the resolution of the system clock. Depending on any granularity (particularly a granularity of one) renders code non-portable.


ftime(): XPG4.2

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.