ftime() — Set the date and time

Standards

Standards / Extensions C or C++ Dependencies

XPG4.2
Single UNIX Specification, Version 3

both  

Format

#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/timeb.h>

int ftime(struct timeb *tp);

General description

The ftime() function sets the time and millitm members of the timeb structure pointed to by tp to contain seconds and milliseconds, respectively, of the current time in seconds since 00:00:00 Coordinated Universal Time (UTC), January 1, 1970.

Note: The ftime() function has been moved to the Legacy Option group in Single UNIX Specification, Version 3 and may be withdrawn in a future version. The time() function is preferred for portability.

Returned value

If successful, ftime() returns 0.

If overflow occurs, ftime() returns -1.

1

Related information

1 Overflow occurs when the current time in seconds since 00:00:00 UTC, January 1, 1970 exceeds the capacity of the time member of the timeb structure pointed to by tp. The time member is type time_t.