Operator Type:
Operator Scope of Action:
Operator Purpose:
Data Type Returned:
Operator First Added:
Operator in Current Baseline:
Operator Last Altered:
Function [other Function type actions]
Item [operators of similar scope]
Date-time [other Date-time operators]
Interval
v9.5.0
Baseline
As at baseline
interval(dataStr)
The operator interval(dataStr) converts a string to an interval. For example:
$MyInterval = interval("00:30:00")
is an interval of thirty minutes.
The dataStr can be a literal string, String-type attribute value or a string variable. The string must be in Interval, for which see the 'Alternative syntax' section of the Interval data type.) For instance:
var:number vHr = 21;
var:number vMin = 14;
var:string vInterval = vHr+":"+vMin;
$MyInterval = interval(vInterval);
The two Date-type argument version of interval() is documented separately, see interval(start,end): it continues to return the Interval between two Date-type arguments.
If any time element is larger than expected, it is parsed to increment the next larger time element. Thus:
$MyInterval = interval("00:90:00")
evaluates as if:
$MyInterval = interval("01:30:00")
This can be helpful, especially if using calculated variables (as above) and where the calculated value may be more than expected if setting values manually.
See also—notes linking to here: