differenceBetweenDates - date format between 7.2 and 7.4
Hello! We are upgrading from Pega 7.2 to 7.4. We use the OOB differenceBetweenDates in several spots in our existing applications. We are often using currentDate() function to get the current date as one parameter for the differenceBetweenDates function. We find this now errs because currentDate("","") returns the format YYYYNovDD, where Nov = November, or whatever month it currently is. And differenceBetweenDates no longer allows this format.
One solution is to use getCurrentDateStamp() as that returns the format YYYYMMDD which works with differenceBetweenDates. Alternatively we change what parameters we are sending currentDate().
The downside is we have to make this change in many spots in the system. It is possible some day this could break again for the format accepted by differenceBetweenDates changes again.
We could instead customize differenceBetweenDates to allow the format we want. Then we only need one code change instead of many. The downside is that it is customization of OOB code, which we are trying to do less of.
Does anyone have any insight into the reason the formatting required by differenceBetweenDates changed between 7.2 and 7.4? I have seen at least one community post where a similar thing happened with the same function at some point between v6.2 and v7.1.6, though we did not experience any problem back then.
Thanks for any thoughts!
***Edited by Moderator Marissa to update platform capability tags****
Keep up to date on this post and subscribe to comments
- Is it possible to extract date time fields into other format instead of Pega date format in BIX 6.3?
- how to covert julian date to normal date format for example: juliandate- 2013123 should be as 3 May, 2013 or yyyymmdd format
- String format date (DD.MM.YYYY) conversion to Date format (MM/DD/YYYY)
- Formatting GMT Date format to MM/DD/YYYY HH:MM:SS
- Date format switches from correct format to stored value