Skip to main content
Version: 8.1

timeBetween

This function is used by Ignition's Expression language.

Description​

Checks to see if the given time is between the start and end times. The given times are expected as strings, and may include dates.

note

Dates will be parsed according to the default system culture.

Syntax​

timeBetween(date, startDate, endDate)

Parameters​

TypeParameterDescription
Date/StringdateThe date or time to compare. Can be a Date object or a string.
Date/StringstartDateThe start date or time. Can be a Date object or a string.
Date/StringendDateThe end date or time. Can be a Date object or a string.

Returns​

Boolean - Returns true if the given date or time is between the startDate and endDate, or false if it is not.

Examples​

Code Snippet
timeBetween(toDate("2003-9-14 12:00:00"), toDate("2003-9-14 8:00:00"),toDate("2003-9-14 18:00:00")) //Returns true.
Code Snippet
timeBetween("2:00:00 pm", "9:00:00 am", "5:00:00 pm") //Returns true.
Code Snippet
timeBetween(toDate("2003-9-14 20:00:00"), toDate("2003-9-14 18:00:00"), toDate("2003-9-15 2:00:00")) //Returns true.