Minor correction: the comment in the sample policy should refer to the "Format" value, not the "Formula" value.
------------------------------
Jay MacDonald - Adoption Architect - Broadcom API Management (Layer 7)
------------------------------
Original Message:
Sent: May 25, 2022 03:58 PM
From: Jay MacDonald
Subject: Re: How can I get the difference(no. of days) between two dates coming as parameter in url?
Hi Enzo,
Load the attached policy in a Web API service on the Gateway. Refer to the inline comments for details. Let me know if this resolves your question.
Cheers!
JayMac
------------------------------
Jay MacDonald - Adoption Architect - Broadcom API Management (Layer 7)
Original Message:
Sent: May 20, 2022 02:58 AM
From: Enzo Fusca
Subject: Re: How can I get the difference(no. of days) between two dates coming as parameter in url?
Hi Zhijun,
i did not understand how to use xapth (do you meane Evalute Request/Response Xpath assertion?) to calulcate the difference between the two values in seconds?
Cuold you please better specify?
Thank you
Original Message:
Sent: May 29, 2018 07:10 PM
From: Zhijun He
Subject: Re: How can I get the difference(no. of days) between two dates coming as parameter in url?
In addition to Remco Dekker 's comment, the set context variable assertion can set date/time type of variable. Then you can use ${variable.seconds} to get the value of the variable in second timestamp format. Then you can use xpath to calculate the difference of the seconds and divide by 3600*24 to turn to days.