Support Article
Output of the addTime function is incorrect
SA-76617
Summary
The out-of-the-box addTime function output for the below dates is incorrect.
- 30th June 2019
- 30th September 2019
Error Messages
Not Applicable
Steps to Reproduce
- Create two fields of type DateTime.
- For one of the columns, set the value as 30th September 2019 (or any quarter end date).
- Create a new calendar instance with any time zone.
- Use the below function to calculate the value of the other field.
@addTime(.Install_Date, -10, 0, 0, 0, true,Param.Calendar)
Instead of .Install_Date, provide the value of the first field and pass the name of the new calendar instance created instead of Param.Calendar.
For example:
@addTime( 20190930T000000.000 GMT, -10, 0, 0, 0, true, Calendar_CA_2019 )
Root Cause
The API, that was used to parse the input DateTime, used the JDK's internal Date parser which parsed the date in UTC standard. Hence, the input DateTime passed to addTime API was always in GMT and the value returned was also in GMT.
There was no API that parsed the DateTime to the given timezone.
Resolution
An enhancement request, FDBK-30873, is created for consideration by Pega Product Management.
Published August 15, 2019 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.