Hello Team,
I wants to convert Current Date/Time to EST Date/Time, to do some lookback period validation on one out API’s.
Could you please suggest the code to do the above requirement?
Hello Team,
I wants to convert Current Date/Time to EST Date/Time, to do some lookback period validation on one out API’s.
Could you please suggest the code to do the above requirement?
Hello @Aravind_1 ,
Have you been able to review the following thread here: Javascript Policy which covers most of what you are looking for (including reference code in Javascript). If yes, do you have any specific questions/concerns?
Hey,
Hope you’re keeping well.
In Apigee, you can handle time zone conversions directly with JavaScript or Python callouts, or using the Date functions in a JavaScript policy. For example, in JavaScript you can create a Date object from the current GMT time and use toLocaleString(“en-US”, { timeZone: “America/New_York” }) to get EST. Attach the script as a JavaScript policy in your API proxy flow, then store the converted timestamp in a variable for your lookback validation. This avoids relying on external services and keeps the logic within Apigee runtime.
Thanks and regards,
Taz