SIMPOL Documentation

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

ParameterDefault valueType nameDescription
time.nulinteger The microsecond count to be assigned to the new object.

Properties

PropertyTypeDescription
typetype Specifies the time type object.

Methods

hours()

Description

Returns the number of hours in the time value.

Prototype

timevar.hours ( boolean total )

Parameters
ParameterDefault valueType nameDescription
total.trueboolean 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
ParameterDefault valueType nameDescription
total.trueboolean 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
ParameterDefault valueType nameDescription
total.trueboolean 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
ParameterDefault valueType nameDescription
total.trueboolean 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
ParameterDefault valueType nameDescription
total.trueboolean 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 microseconds, integer milliseconds, integer seconds, integer minutes, integer hours )

Parameters
ParameterDefault valueType nameDescription
microseconds.nulinteger 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.nulinteger 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.nulinteger 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.nulinteger 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.nulinteger 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