system.date.isBetween

This feature is new in Ignition version 7.8.1

Description

Compares to dates to see if a target date is between two other dates.

Syntax

system.date.isBetween (target_date, start_date, end_date )

  • Parameters

Date target_ date - The date to compare.

Date start_date - The start of a date range.

Date end_date - The end of a date range. This date myst be after the start date.

  • Returns

Bool - True (1) if target_date is >= start_date and target_date <= end_date, false (0) otherwise.

  • Scope

All

Code Examples
Code Snippet
#This will compare if the first date is between the other dates, which it is not.
#Note that if the end date is before the start date, this function will always return False
 
target = system.date.getDate(2017, 4, 28)
start = system.date.getDate(2017, 3, 22)
end = system.date.getDate(2017, 4, 22)
print system.date.isBetween(target, start, end) #Will print false.