Skip to main content
Version: 8.1

dateIsBetween

This function is used by Ignition's Expression language.

Description​

Compares two dates to see if a target date is between two other dates. This is inclusive, meaning if the targetDate is the same as the start or end date the result is true.

Syntax​

dateIsBetween(targetDate, startDate, endDate)

Parameters​

TypeParameterDescription
DatetargetDateThe date to compare.
DatestartDateThe start of the date range.
DateendDateThe end of the date range. This date must be after the start date.

Returns​

Boolean - Returns true if the targetDate is between (or equal to) the startDate and endDate. Returns false otherwise.

Examples​

Code Snippet
dateIsBetween(now(), toDate("2016-06-12 00:00:00"), toDate("2016-06-19 00:00:00"))
// Will be true if the current time is between the 12th and 19th of June 2016.