date module

date::diff

Calculate the difference between two dates.

Syntax

RQL

Parameters

NameTypeDescription
date1Date/TimestampThe first (later) date
date2Date/TimestampThe second (earlier) date
unitUtf8The unit of time to return (e.g., "days", "hours")

Return Value

Returns a number representing the difference between the two dates in the specified unit.

Examples

$ Calculate difference between dates
$ ctrl+enter to run

Related Functions