@Martin Kallukalam Thanks for reaching out. The error you’re encountering is because the subtraction operator -
cannot be directly applied to objects in the way you’re attempting.
please refer the below policy
<inbound>
<base />
<set-variable name="tstartretrypolicy1" value="@(DateTime.UtcNow)" />
<retry condition="@(true)" count="1" interval="2" />
<set-variable name="tsendretrypolicy1" value="@(DateTime.UtcNow)" />
<set-variable name="texecretrypolicy1" value="@(Convert.ToDateTime(context.Variables["tsendretrypolicy1"]) - Convert.ToDateTime(context.Variables["tstartretrypolicy1"]))" />
</inbound>
Hope this helps! do let me know incase of further queries, I would be happy to assist you.