Hello Apigee Community,
What's the best way to convert a JSON variable from EPOCH to DateTime?
Can this be done via JavaScript Policy?
If so, do you have an example?
Thank you!
Solved! Go to Solution.
This ended up working for me:
var dateTime = JSON.parse(context.getVariable('PaymentDateTime')); var PaymentDateTime = new Date(dateTime * 1000).toISOString("yyyy'-'MM'-'dd HH':'mm':'ss'Z'"); context.setVariable("PaymentDateTime", PaymentDateTime);