time
Description
Objects of type time contain a value which represents a time of day or a time interval, and can be accessed either as a whole or by component, such as hour, minute and second. Valid times are from zero to 9999 years.
Type Tags
None
Object Value
The value of an object of type time is the number of microseconds in the time value, and can be read or written.
time.new()
Description
Creates a new time object and sets its initial value.
Prototype
time
.new
(
integer
)
time
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
time | .nul | integer | The microsecond count to be assigned to the new object. |
Properties
Property | Type | Description |
---|---|---|
type | type | Specifies the time type object. |
Methods
hours()
Description
Returns the number of hours in the time value.
Prototype
timevar
.hours
(
boolean
)
total
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
total | .true | boolean |
Indicates whether hours are to be counted from time zero or from the last
whole day. If .false then the hours component
of the time value is returned. If .true then
the total number of hours in the time value is returned. If the
value of this parameter is either .nul or
.inf then the result will be
.nul .
|
microseconds()
Description
Returns the number of microseconds in the time value.
Prototype
timevar
.microseconds
(
boolean
)
total
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
total | .true | boolean |
Indicates whether microseconds are to be counted from time zero or from the
last whole millisecond. If .false then the
microseconds component of the time value is returned. If
.true then the total number of microseconds in
the time value is returned. If the value of this parameter is
either .nul or .inf then
the result will be .nul .
|
milliseconds()
Description
Returns the number of milliseconds in the time value.
Prototype
timevar
.milliseconds
(
boolean
)
total
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
total | .true | boolean |
Indicates whether milliseconds are to be counted from time zero or from the
last whole second. If .false then the
milliseconds component of the time value is returned. If
.true then the total number of milliseconds in
the time value is returned. If the value of this parameter is
either .nul or .inf then
the result will be .nul .
|
minutes()
Description
Returns the number of minutes in the time value.
Prototype
timevar
.minutes
(
boolean
)
total
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
total | .true | boolean |
Indicates whether minutes are to be counted from time zero or from the last
whole hour. If .false then the minutes
component of the time value is returned. If
.true then the total number of minutes in the
time value is returned. If the value of this parameter is either
.nul or .inf then the
result will be .nul .
|
seconds()
Description
Returns the number of seconds in the time value.
Prototype
timevar
.seconds
(
boolean
)
total
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
total | .true | boolean |
Indicates whether seconds are to be counted from time zero or from the last
whole minute. If .false then the seconds
component of the time value is returned. If
.true then the total number of seconds in the
time value is returned. If the value of this parameter is either
.nul or .inf then the
result will be .nul .
|
set()
Description
Sets or changes the value in a time object from the components specified. Any or all components can be specified.
Prototype
timevar
.set
(
integer
,
integer microseconds
,
integer milliseconds
,
integer seconds
,
integer minutes
)
hours
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
microseconds | .nul | integer |
Specifies the microseconds component of the new time value, which must be in
the range 0 to 999. If the value of this parameter is
.nul then the time will be set to
.nul and if the value of this parameter is
.inf then the time will be set to
.inf .
|
milliseconds | .nul | integer |
Specifies the milliseconds component of the new time value, which must be in
the range 0 to 999. If the value of this parameter is
.nul then the time will be set to
.nul and if the value of this parameter is
.inf then the time will be set to
.inf .
|
seconds | .nul | integer |
Specifies the seconds component of the new time value, which must be in the
range 0 to 59. If the value of this parameter is
.nul then the time will be set to
.nul and if the value of this parameter is
.inf then the time will be set to
.inf .
|
minutes | .nul | integer |
Specifies the minutes component of the new time value, which must be in the
range 0 to 59. If the value of this parameter is
.nul then the time will be set to
.nul and if the value of this parameter is
.inf then the time will be set to
.inf .
|
hours | .nul | integer |
Specifies the hours component of the new time value, which must be in the
range 0 to 87649415. If the value of this parameter is
.nul then the time will be set to
.nul and if the value of this parameter is
.inf then the time will be set to
.inf .
|
setnow()
Description
Sets the specified object to now according to the OS and returns the value of now for the time type.
Prototype
timevar
.setnow
()
Parameters
None