Question
Convert datetime to a given time zone
Hi,
I am creating a When Rule for comparing an "ActivationDate" datetime property with the current date.
Since PEGA is loading the "ActivationDate" value from data base converting it to GMT, it is substracting 2 hours (from CEST to GMT time zone).
To do properly the comparation and check if the "Activation" anniversary is today, I should transform the ActivationDate property to CEST time zone.
I am trying using the OOTB @DatetTime.toLOCAL function, but it seems not to work.
In the examples below:
- when using "CEST" is restarting 2 hours to the GMT time, and it should be 2 hours more.
- when using "Europe/Madrid" is returning the same hour that the GMT time, and if should be 2 hours more.
Any advice about how to use the toLOCAL function or how could the convertion be done?
Thank you
Miguel
***Edited by Moderator Marissa to update Platform Capability tags****
Hi Miguel,
You can give a try on the FormatDateTime function.
This will return the current time of CEST like 20200704T111559.696 GMT+02:00
To compare Dates, you can use the CompareDates function.
The above code might suit your scenario.
I hope it helps you!
Good Luck!