# Class System.TM

Description

  A wrapper for the system struct tm time keeping structure. This can be used as a (very) lightweight alternative to Calendar.

Variable gmtoff

  `int System.TM.gmtoff`

Description

  The offset from GMT for the time in this tm-struct

Variable sec
Variable min
Variable hour
Variable mday
Variable mon
Variable year

  `int(0..60) System.TM.sec`
  `int(0..59) System.TM.min`
  `int(0..59) System.TM.hour`
  `int(1..31) System.TM.mday`
  `int(0..11) System.TM.mon`
  `int System.TM.year`

Description

  The various fields in the structure. Note that setting these might cause other fields to be recalculated, as an example, adding 1000 to the hour field would advance the 'mday', 'mon' and possibly 'year' fields.

  When read the fields are always normalized.

  Unlike the system struct tm the 'year' field is not year-1900, instead it is the actual year.

Variable isdst

  `int System.TM.isdst`

Description

  True if daylight savings are in effect. If this field is -1 (the default) it (and the timezone info) will be updated automatically using the timezone rules.

Variable wday

  `int System.TM.wday`

Description

  The day of the week, sunday is 0, saturday is 6. This is calculated from the other fields and can not be changed directly.

Variable yday

  `int System.TM.yday`

Description

  The day of the year, from 0 (the first day) to 365 This is calculated from the other fields and can not be changed directly.

Variable zone

  `string System.TM.zone`

Description

  The timezone of this structure

Method create

  `System.TM System.TM(int t)`

Description

  Create a new TM initialized from a unix time_t. The timezone will always be UTC when using this function.