Discussion

Maantic Global
IN
Last activity: 26 Jun 2025 12:46 EDT
Determine EST or EDT Dynamically and convert date time into GMT
Problem: From External system we receive Date time field that is in America/New_York time zone. But to save this into pega property, it has to be formatted to either EST or EDT which changes dynamically based on Day light savings.
Solution:
First to derive the EST or EDT we used below function which gives time zone using current date time stamp
@FormatDateTime(@getCurrentTimeStamp(), "z", "America/New_York", "")
Param.TimeZone = EDT
Then we concatenate this to the date time received from API and mapped to a date time property in Pega.
Param.TestDateTime =20250626T120101.000 + " "+Param.TimeZone
To convert EST or EDT date time into GMT, we can use addtoDate function
@addToDate(Param.TestDateTime,0,0,0,0)