Time
The Time class represents an immutable duration or time-of-day value, expressed in hours, minutes, and seconds. Time is automatically available in scripts — no import is needed to construct one.
Fields
| Field | Type | Description |
|---|---|---|
hours | integer | Read only. The hours component. |
minutes | integer | Read only. The minutes component, from 0 to 59. |
seconds | integer | Read only. The seconds component, from 0 to 59. |
totalSeconds | integer | Read only. The total value expressed in seconds. |
Constructors
init( )
Constructs a zero-valued
Time(zero duration / midnight).
init( hours )
Constructs a
Timefrom a floating-point hours value. For example,Time(8.5)represents 8 hours and 30 minutes.
init( hours, minutes, seconds )
Constructs a
Timefrom integer hours, minutes, and seconds components. For example,Time(8, 0, 0)represents 8 hours.