Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Virtusa
IN
Last activity: 26 Jul 2021 3:48 EDT
FormatDateTime gives incorrect GMT format for America/Vancouver or Canada/Central or simila timezone
When using the below function,
@FormatDateTime("20210909T010101.000 GMT", "","America/Vancouver","")
i get output as
20210908T180101.000 PDT (CA) |
Now, because of this extra element "(CA)", this value cannot be used to set to any DateTime property or perform any DateTime operation such as AddToDate. It gives error as below
[STACK][com.pega.pegarules.pub.clipboard.InvalidParameterException: value 20210719T091045.748 PDT (CA) is not a valid Date or DateTime string. Details: Invalid value for theDate passed to com.pega.pegarules.exec.internal.util.PRDateTimeUtilsImpl.addToDate(String, String, String, String, String)<CR> at com.pega.pegarules.exec.internal.util.PRDateTimeUtilsImpl.addToDate(PRDateTimeUtilsImpl.java:174)<CR> at com.pegarules.generated.addToDate_080101_1506794947446549432.addToDate08_01_01(addToDate_080101_1506794947446549432.java:119)<CR> at com.pegarules.generated.addToDate_080101_1506794947446549432.invoke(addToDate_080101_1506794947446549432.java:74)<CR>
We are trying to perform the below below function
@addToDate(@FormatDateTime(Param.FromDate, "", OperatorID.pyDefaultTimeZone, ""), "1", "0", "0", "0")
Can someone please help to debug the issue