1.TH time.h 3 scc\-VERSION2.SH NAME3time.h - time and date types and functions4.SH SYNOPSIS56#include <time.h>78The time.h header declares the following functions:910.nf11char asctime(const struct tm *tm);12clock_t clock(void);13char ctime(const time_t *timep);14double difftime(time_t t1, time_t t2);15struct tm *gmtime(const time_t *timep);16struct tm *localtime(const time_t *timep);17time_t mktime(struct tm *tm);18size_t strftime(char *restrict, size_t, const char *restrict,19 const struct tm *restrict);20time_t time(time_t *timer);21.fi22.SH DESCRIPTION23The time.h header defines the following macros:2425.B NULL2627An implementation-defined null pointer constant,28identical to the one defined in stddef.h.2930.B CLOCKS_PER_SEC3132The number of clock ticks per second,33used to convert the value returned by34.BR clock ()35to seconds. Its type is36.IR clock_t .3738The time.h header defines the types39.BR clock_t ,40.BR size_t ,41and42.BR time_t .4344The time.h header declares the45.B tm46structure,47which holds a broken-down representation of time48and contains at least the following members:4950.nf51int tm_sec Seconds [0,60]52int tm_min Minutes [0,59]53int tm_hour Hour [0,23]54int tm_mday Day of month [1,31]55int tm_mon Month of year [0,11]56int tm_year Years since 190057int tm_wday Day of week [0,6] (Sunday = 0)58int tm_yday Day of year [0,365]59int tm_isdst Daylight Savings flag60.fi6162The members of the63.I tm64structure are:65.TP 1066tm_sec67Seconds elapsed after the minute, normally 0 to 59,68but up to 60 to accommodate leap seconds.69.TP70tm_min71Minutes elapsed after the hour, in the range 0 to 59.72.TP73tm_hour74Hours elapsed since midnight, in the range 0 to 23.75.TP76tm_mday77The calendar day of the month, in the range 1 to 31.78.TP79tm_mon80Months elapsed since January, in the range 0 to 11.81.TP82tm_year83Years elapsed since 1900.84.TP85tm_wday86Days elapsed since Sunday, in the range 0 to 6.87.TP88tm_yday89Days elapsed since January 1st, in the range 0 to 365.90.TP91tm_isdst92A flag indicating whether daylight saving time applies.93Positive if in effect, zero if not, and negative if unknown.94.SH STANDARDS95ISO/IEC 9899:1999 Section 7.23.1 Paragraph 1,2,3,496.SH SEE ALSO97.BR clock (3)98.BR ctime (3)99.BR difftime (3)100.BR strftime (3)101.BR time (3)