Support Article
CurrentDate function retrieves the incorrect date
SA-98055
Summary
The CurrentDate function retrieves the incorrect Date.
For example,
For the CurrentDate, 20201230 is retrieved instead of 20191230 in YYYYMMdd format.
Error Messages
Not Applicable
Steps to Reproduce
Pass the below function to Param.CurrentDate.
@(Pega-RULES:DateTime).CurrentDate(YYYYMMdd, GMT)
Root Cause
YYYY is used as the function parameter to the CurrentDate.
This is an expected behavior. Using 'YYYY' returns the 'Current week Year' value.
Resolution
Perform the following local-change to retrieve the value of current year:
Change 'YYYY' to 'yyyy'.
Published January 17, 2020 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.