DATETIME_IS_BETWEEN
Check if a datetime is between two other datetimes

Description

Returns true if a datetime is between the given other two datetimes, and false otherwise.
By default, returns false if the datetime is exactly same as either of the boundary datetimes. This behavior can be modified by providing the optional Borders type parameter.

Function signature

1
DATETIME_IS_BETWEEN(date: String, dateborder1: String, dateborder2: String, precision: String, borderstype: String = ()) => Boolean
Copied!
Parameter
Description
Date
Date to check
Date border 1
The 1st date border
Date border 2
The 2nd date border
Precision
Precision for comparing ("year","month","week","isoWeek","day","hour","minute","second")
Borders type
Type of border inclusion ("()", "(]", "[)", "[]")

Examples

Formula
Return value
DATETIME_IS_BETWEEN("2019-06-20T12:13:14Z", "2019-06-19T12:13:14Z", "2019-06-21T12:13:14Z")
true
DATETIME_IS_BETWEEN("2019-06-20T12:13:14Z", "2019-06-19T12:13:14Z", "2021-06-21T12:13:14Z", "year")
false
DATETIME_IS_BETWEEN("2019-06-20T12:13:14Z", "2019-06-20T12:13:14Z", "2019-06-21T12:13:14Z", null , "[]")
true
Export as PDF
Copy link