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]
Number [about Number data type]
v4.0.0
Baseline
As at baseline
days(firstDate, lastDate)
returns the Number of 'days' (as defined below) that elapsed between firstDate and lastDate. If lastDate is earlier than firstDate then the result is negative.
The operator returns the number of 24-hour blocks [sic] between two dates, rounded toward zero. So if days() measures the difference between a date/time of 09:30 today and 08:30 tomorrow, the result is 0 (zero) as the difference is only 23 hours. If the times are same a whole day increment is recorded.
Thus days does not return a simplistic calendar day difference as some users might intuit it would. If times vary between firstDate and lastDate, the returned difference figure may thus be one day high or low of an expected calendar day-based value.
If $DateA is 3 January 2016 and $DateB is 9 January 2016, then:
$MyNumber = days($DateA,$DateB);
sets $MyNumber to 6.
Also see minutes(date1,date2).
See also—notes linking to here: