Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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'.
Suggest Edit

Published January 17, 2020 - Updated October 8, 2020

Did you find this content helpful? Yes No

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us