tm

Contains time information.

Service:Time

Structure

  #include <time.h>
  
  struct tm 
  {
     int   tm_sec; 
     int   tm_min; 
     int   tm_hour; 
     int   tm_mday; 
     int   tm_mon; 
     int   tm_year; 
     int   tm_wday; 
     int   tm_yday; 
     int   tm_isdst; 
  };
  

Fields

tm_sec

Specifies the number of seconds after the minute. This number is in the range [0,59].

tm_min

Specifies the number of minutes after the hour. This number is in the range [0,59].

tm_hour

Specifies the number of hours after midnight. This number is in the range [0,23].

tm_mday

Specifies the day of the month. This number is in the range [1,31].

tm_mon

Specifies the months since January. This number is in the range [0,11].

tm_year

Specifies the number of years since 1900. This number is in the range [0,i].

tm_wday

Specifies the number of days since Sunday. This number is in the range [0,6].

tm_yday

Specifies the number of days since January 1. This number is in the range [0,365].

tm_isdst

Specifies a Daylight Savings Time flag, defined as follows:

0

Daylight savings time is not in effect.

>0

Daylight savings time is in effect.

-1

Daylight savings time information is not available.

Remarks

The original values of the tm_sec, tm_min, tm_hour, tm_mday, and tm_mon fields are not restricted to ranges described for the tm structure. If these fields are not in their proper ranges, they are adjusted so that they are in the proper ranges. Values for the tm_wday and tm_yday fields are computed after all the other fields have been adjusted.

Some locales such Korean, Chinese, and Italian use the tm_wday structure field for the standard date format. If the tm_wday structure field is not set, an incorrect day will be displayed. An application which sets only the year, month, and day structure fields can compute the weekday by calling the mktime function:

   mktime(timePtr)