TM Data Structure

[ return to article ]

The TM data structure contains the 9 subfields listed below. It is included in the TIME /COPY source member.

.....DName+++++++++++EUDS.......Length+TDc.Functions++++++++++++++++++++++++++++
     D int4            S             10i 0
     D tm              DS                  
     D  tm_sec                             Like(int4)
     D  tm_min                             Like(int4)
     D  tm_hour                            Like(int4)
     D  tm_mday                            Like(int4)
     D  tm_mon                             Like(int4)
     D  tm_year                            Like(int4)
     D  tm_wday                            Like(int4)
     D  tm_yday                            Like(int4)
     D  tm_isdst                           Like(int4)

 

The TM data structure contains nine 4-byte integer fields. To get a date, only fields 4 through 6 need to be something other than zero. The table below documents each of the TM data structure's subfields.

Type Subfield Description
10i0 (int) tm_sec seconds (0 to 59)
10i0 (int) tm_min minutes (0 to 59)
10i0 (int) tm_hour hour (0 to 23)
10i0 (int) tm_mday day of month (1 to 31)
10i0 (int) tm_mon month (0 to 11)
10i0 (int) tm_year year minus 1900 (e.g., 1978 = 78)
10i0 (int) tm_wday day of week (0 to 6)
10i0 (int) tm_yday day of year (0 to 365)
10i0 (int) tm_isdst "Is daylight savings time?"
0 = No daylight savings
1 = Daylight savings
-1 = Unknown