CA API Gateway: Checking if a date is valid

Document ID : KB000122934
Last Modified Date : 12/12/2018
Show Technical Document Details
Sometimes it may be necessary to perform date validation to confirm invalid data is not supplied.

For example, you may need to prevent bad data like February 52, 2018 from being sent.
The attached sample policy retrieves a data from a JSON Payload and validates it.
To test other values simply change the variable declaration on line 2.

This will also check for valid leap years. February 29, 2018 will fail where as February 29, 2020 will success as it is a valid leap year.
File Attachments: