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
Date/String date - The date to compare. Can be either a date or a string.
Date/String startDate - The start date to compare to. Can be either a date or a string.
Date/String endDate - The end date to compare to. Can be either a date or a string.
Results
- Boolean - True if the date is between the start and end date, False if 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.