DATETIME_DIFFERENCE
Calculate difference between two datetimes

Description

Returns the difference between the given two datetimes in the given unit of time.

Function signature

1
DATETIME_DIFFERENCE(date1: String, date2: String, units: String = milliseconds, indecimal: Boolean) => Number
Copied!
Parameter
Description
Date 1
Date 1
Date 2
Date 2
Units
Returned units ("years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds" , "milliseconds")
In decimal
Prevent truncate of returned result (true, false)

Examples

Formula
Return value
DATETIME_DIFFERENCE("2019-07-11T13:06:15+03:00", "2019-07-11T13:06:15+03:00")
0
DATETIME_DIFFERENCE("2019-07-11T13:06:15+03:00", "2018-07-11T13:06:15+03:00", "hours")
8760
DATETIME_DIFFERENCE("2019-07-11T13:06:15+03:00", "2018-07-11T13:06:15+03:00", "weeks", true)
52.14285714
Export as PDF
Copy link