6.22.1 time.h Types and Macros

clock_t

A type that can hold processor time values, as returned by the clock function.

Include

<time.h>

Definition

typedef unsigned long clock_t;

struct tm

Structure used to hold the components of a calendar time, called the broken-down time

Include

<time.h>

Definition

struct tm {
  int  tm_sec;           /*seconds after the minute ( 0 to 61 )*/
                         /*allows for up to two leap seconds*/
  int  tm_min;           /*minutes after the hour ( 0 to 59 )*/
  int  tm_hour;          /*hours since midnight ( 0 to 23 )*/
  int  tm_mday;          /*day of month ( 1 to 31 )*/
  int  tm_mon;           /*month ( 0 to 11 where January = 0 )*/
  int  tm_year;          /*years since 1900*/
  int  tm_wday;          /*day of week ( 0 to 6 where Sunday = 0 )*/
  int  tm_yday;          /*day of year ( 0 to 365 where January 1 = 0 )*/
  int  tm_isdst;         /*Daylight Savings Time flag */
  long __tm_gmtoff;      /*number of seconds offset from UTC to get local time*/
  const char *__tm_zone; /*name of the time zone*/
}

Remarks

If tm_isdst is a positive value, Daylight Savings is in effect. If it is zero, Daylight Saving Time is not in effect. If it is a negative value, the status of Daylight Saving Time is not known.

time_t

A type that can hold calendar time values, as returned by the time function.

Include

<time.h>

Definition

typedef unsigned long time_t;