How to compare Dates using the Webstudio Rule Template?
book
Article ID: KB0093092
calendar_today
Updated On:
Products
Versions
TIBCO BusinessEvents Enterprise Edition
-
Not Applicable
-
Description
Description: How to compare Dates, one date with another date - 3 days using WebStudio Rule Templates. An example has been provided below. This also makes use of the DateTime.after() and DateTime.before() functions and returns a Boolean. Symptoms: N/A Cause: N/A
Issue/Introduction
How to compare Dates using the Webstudio Rule Template?
Resolution
This sample code snippet demonstrates usage of Dates in comparison and compare Dates with -3 days ago.
To check if the date is after or before the input date use: Function: DateTime.after (DateTime d1, DateTime d2)
d1 is a DateTime (date/time) value that will be compared with the second argument. d2 is a DateTime (date/time) that will be compared with the first argument. Returns: boolean true if d1 comes after d2, otherwise return false.
d1 is a DateTime (date/time) that will be compared with the second argument. d2 is a DateTime (date/time) that will be compared with the first argument. Returns: boolean true if d1 comes before d2, otherwise return false.