I have two strings, for example 05.04.2002 and 23.01-2002 - 23.06.2002.
How would I find out if the date in my first string is between the dates in the second string?
What I have been thinking
dateString := '05.04.2002';
dateRangeString := '23.01-2002 - 23.06.2002';
date := StrToDate( dateString );
rangeStart := StrToDate( LeftStr(dateRangeString, 10) );
rangeEnd := StrToDate( RightStr(dateRangeString, 10) );
Now from there I don’t know what to do!
You can use the unit
System.DateUtilsand its function DateInRange:You can also check the fourth parameter of this function (
AInclusive: Boolean = True)… depending on your need…