TIME.H(7) Miscellaneous Information Manual TIME.H(7)

time.htime types

#include <time.h>

The <time.h> header declares the structure tm , which includes at least the following members:

int    tm_sec   seconds [0,61]
int    tm_min   minutes [0,59]
int    tm_hour  hour [0,23]
int    tm_mday  day of month [1,31]
int    tm_mon   month of year [0,11]
int    tm_year  years since 1900
int    tm_wday  day of week [0,6] (Sunday = 0)
int    tm_yday  day of year [0,365]
int    tm_isdst daylight savings flag

The value of is positive if Daylight Saving Time is in effect, 0 if Daylight Saving Time is not in effect, and negative if the information is not available.

This header defines the following symbolic names:

Null pointer constant.
Number of clock ticks per second returned by the times(3) function ( LEGACY ).
A number used to convert the value returned by the clock () function into seconds.

The <time.h> header declares the structure , which has at least the following members: time_t tv_sec seconds long tv_nsec nanoseconds

This header also declares the structure, which has at least the following members: struct timespec it_interval timer period struct timespec it_value timer expiration

The following manifest constants are defined:

The identifier of the systemwide realtime clock.
Flag indicating time is absolute with respect to the clock associated with a timer.

The , , , and types are defined as described in <sys/types.h>.

Although the value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems, it may be variable on other systems and it should not be assumed that CLOCKS_PER_SEC is a compile-time constant.

The value of CLK_TCK is currently the same as the value of sysconf (_SC_CLK_TCK); however, new applications should call sysconf () because the CLK_TCK macro may be withdrawn in a future issue.

The <time.h> header provides a declaration for .

The following are declared as functions and may also be defined as macros. Function prototypes must be provided for use with an ISO C compiler. char *asctime(const struct tm *); char *asctime_r(const struct tm *, char *); clock_t clock(void); int clock_getres(clockid_t, struct timespec *); int clock_gettime(clockid_t, struct timespec *); int clock_settime(clockid_t, const struct timespec *); char *ctime(const time_t *); char *ctime_r(const time_t *, char *); double difftime(time_t, time_t); struct tm *getdate(const char *); struct tm *gmtime(const time_t *); struct tm *gmtime_r(const time_t *, struct tm *); struct tm *localtime(const time_t *); struct tm *localtime_r(const time_t *, struct tm *); time_t mktime(struct tm *); int nanosleep(const struct timespec *, struct timespec *); size_t strftime(char *, size_t, const char *, const struct tm *); char *strptime(const char *, const char *, struct tm *); time_t time(time_t *); int timer_create(clockid_t, struct sigevent *, timer_t *); int timer_delete(timer_t); int timer_gettime(timer_t, struct itimerspec *); int timer_getoverrun(timer_t); int timer_settime(timer_t, int, const struct itimerspec *, struct itimerspec *); void tzset(void);

The following are declared as variables: extern int daylight; extern long int timezone; extern char *tzname[];

The range [0,61] for tm_sec allows for the occasional leap second or double leap second.

is a signed value, therefore years before 1900 may be represented.

The functions , , , , , , , , and are part of the feature(3).

None.

asctime(3) , asctime(3) , clock(3) , clock_settime(3) , ctime(3) , ctime(3) , daylight(3) , difftime(3) , getdate(3) , gmtime(3) , gmtime(3) , localtime(3) , localtime(3) , mktime(3) , nanosleep(3) , strftime(3) , strptime(3) , sysconf(3) , time(3) , timer_create(3) , timer_delete(3) , timer_settime(3) , timezone(3) , tzname(3) , tzset(3) , utime(3) .

February 1997 posix.fail