scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

time.h.3 (2308B)


      1 .TH time.h 3
      2 .SH NAME
      3 time.h - time types
      4 .SH SYNOPSIS
      5 
      6 #include <time.h>
      7 
      8 The time.h header declares the following functions:
      9 
     10 .nf
     11 char asctime(const struct tm *tm);
     12 clock_t clock(void);
     13 char ctime(const time_t *timep);
     14 double difftime(time_t t1, time_t t2);
     15 struct tm *gmtime(const time_t *timep);
     16 struct tm *localtime(const time_t *timep);
     17 time_t mktime(struct tm *tm);
     18 size_t strftime(char *restrict, size_t, const char *restrict,
     19                 const struct tm *restrict);
     20 time_t time(time_t *timer);
     21 .fi
     22 .SH DESCRIPTION
     23 The time.h header defines the following macros:
     24 
     25 .B NULL
     26 
     27 It expands to an implementation-defined null pointer constant,
     28 as defined in stddef.h header.
     29 
     30 .B CLOCKS_PER_SEC
     31 
     32 A number used to convert the value returned by the
     33 .BR clock ()
     34 function into seconds. The value is an expression with type
     35 clock_t.
     36 
     37 The time.h header defines the following types:
     38 .BR clock_t ,
     39 .BR size_t ,
     40 .BR time_t .
     41 
     42 The
     43 time.h header declares the
     44 .B tm
     45 structure,
     46 which includes at least the following members:
     47 
     48 .nf
     49 int tm_sec	Seconds[0,60]
     50 int tm_min	Minutes[0,59]
     51 int tm_hour 	Hour[0,23]
     52 int tm_mday 	Day of month [1,31]
     53 int tm_mon 	Month of year [0,11]
     54 int tm_year 	Years since 1900
     55 int tm_wday 	Day of week [0,6] (Sunday =0)
     56 int tm_yday 	Day of year [0,365]
     57 int tm_isdst 	Daylight Savings flag
     58 .fi
     59 
     60 The members of the
     61 .I tm
     62 structure are:
     63 .TP 10
     64 tm_sec
     65 The number of seconds after the minute, normally in the range 0 to 59,
     66 but can be up to 60 to allow for leap seconds.
     67 .TP
     68 tm_min
     69 The number of minutes after the hour, in the range 0 to 59.
     70 .TP
     71 tm_hour
     72 The number of hours past midnight, in the range 0 to 23.
     73 .TP
     74 tm_mday
     75 The day of the month, in the range 1 to 31.
     76 .TP
     77 tm_mon
     78 The number of months since January, in the range 0 to 11.
     79 .TP
     80 tm_year
     81 The number of years since 1900.
     82 .TP
     83 tm_wday
     84 The number of days since Sunday, in the range 0 to 6.
     85 .TP
     86 tm_yday
     87 The number of days since January 1, in the range 0 to 365.
     88 .TP
     89 tm_isdst
     90 A flag that indicates whether daylight saving time is
     91 in effect at the time described.
     92 The value is positive if daylight saving time is in
     93 effect, zero if it is not, and negative if the information is not
     94 available.
     95 .SH STANDARDS
     96 ISO/IEC 9899:1999 Section 7.23.1 Paragraph 1,2,3,4
     97 .SH SEE ALSO
     98 .BR clock (3)
     99 .BR ctime (3)
    100 .BR difftime (3)
    101 .BR strftime (3)
    102 .BR time (3)