API Management: Get the difference between two dates
search cancel

API Management: Get the difference between two dates

book

Article ID: 145812

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

We would like to know how can we get the difference(no. of days) between two dates. For example, the input dates will come in query parameters to the Gateway:

&date1=12-11-2019&date2=12-30-2019 

Environment

All supported versions of the API Gateway

Resolution

A sample policy is attached that makes use of the Execute JavaScript Assertion

Additional Information

https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-gateway/10-1/policy-assertions/assertion-palette/service-availability-assertions/execute-javascript-assertion.html 

Attachments

1582637312297__JS-Date-Diff.xml get_app