Integration Server 10.5 | Built-In Services Reference Guide | Date Folder | Summary of Elements in this Folder | pub.date:compareDates
 
pub.date:compareDates
WmPublic. Compares two dates and returns the result as an integer.
Input Parameters
startDate
String Starting date to compare against endDate.
endDate
String Ending date to compare against startDate.
startDatePattern
String Format in which the startDate parameter is specified (for example, yyyyMMdd HH:mm:ss.SSS). For pattern-string notation, see Pattern String Symbols.
endDatePattern
String Format in which the endDate parameter is specified (for example, yyyyMMdd HH:mm:ss.SSS). For pattern-string notation, see Pattern String Symbols.
Output Parameters
result
String Checks whether startDate is before, the same, or after endDate.
A value of...
Indicates that...
+1
The startDate is after the endDate.
0
The startDate is the same as the endDate.
-1
The startDate is before the endDate.
Usage Notes
If the formats specified in the startDatePattern and endDatePattern parameters are different, Integration Server takes the units that are not specified in the starDate and endDate values as 0.
That is, if the startDatePattern is yyyyMMdd HH:mm and the startDate is 20151030 11:11 and if the endDatePattern is yyyyMMdd HH:mm:ss.SSSand the endDate is 20151030 11:11:55:111, then the pub.date:compareDates service considers start date to be before the end date and will return the result as -1.
To calculate the difference between two dates, use the pub.date:calculateDateDifference service.