Posted: 25 Aug 2020 8:21 EDT Last activity: 25 Aug 2020 23:10 EDT
@DateTime.addCalendar is not working properly
@DateTime.addCalendar is not working properly if Operator timezone is in America/New_York. when we are entering date 7/01/2020 from Pega UI then it is adding one month and giving output as 7/31/202.
However when operator timezone is in US/Central then it is working as expected.
Do any one having any idea why it is behaving improperly for the months March,May,July,October,December.when operator timezone is America/New_York. when you select 1st day of above months it gives wrong out put as above. Other than above months it is wotking fine.
I have a requirement where we can't change operator's timezone in production box. Please help to provide the solution.
***Moderator: Pallavi to update platform capability tags***
Not sure why you wouldn't see it for all months. The months you've listed are all 31 day months, you would be getting the wrong outcome if you were adding 30 days instead of 1 month.
A lot of Pega's DateTime library functions - particularly when dealing with "Date Only" fields (that then assume the time portion to be midnight) - can be sensitive to conversions between the user's timezone, GMT and/or the server timezone. This doesn't appear to be the problem if it only happens for some of your months. However if you are only dealing with dates and need to be independent of time, and have someone familiar with Java on your team, you may benefit from implementing your own Function that avoids having to consider times and timezones.