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
v6.3.1
Baseline
As at baseline
interval(startDate, endDate)
The function interval(startDate,endDate) returns, in Interval data-type form, the time interval between two Date-type dates. For example, to test the interval between a note's initial creation and its most recent modification and to then store it in an Interval-type attribute:
$MyInterval = interval($Created,$Modified);
The interval() function can be used to test the exact equivalence of two Date-type attribute values, using the full Date and time. Thus:
if(interval($DateA,$DateB)=="00:00"){…
The latter gets around the fact that ==
and !=
operators match Date-type attributes only at day scope rather than the actual date-time values.
If needing the duration expressed in whole time units of a particular time element (or hours, etc.), see days(), hours(), minutes() or seconds().
The single argument method of interval(), used to create Interval-type data is documented separately—see interval(dataStr).
See also—notes linking to here: