Is there a way to get current timestamp in W3C WSDL date format -> YYYY-MM-DDThh:mm:ssTZD
in Apigee Edge using java script without any 3rd party package installation?
Eg:
2013-06-09T14:04:54-08:00
Any one got it worked?
-Vinay
Hi @Kamal I believe this sample js policy should do the trick:
var formattedDate = new Date(context.getVariable("system.timestamp")).toISOString(); context.setVariable("formattedDate", formattedDate);
See sample response in the header that I am returning in the screen shot below
The "formattedDate" variable can be used wherever you need to reference the current date/time in your proxy.
Let me know if this gives you what you are looking for?
@Prithpal Bhogill , Above output is slightly different from OP query. Final part is not TZD. See similar question asked here.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |