Support Article
System Datetime func. wrong due to YYYYMMdd mask (s/b yyyyMMdd)
SA-18245
Summary
User reports that @PegaRULES Date/Time function defaulting to 12/27/2016; which is causing their validation to fail and impacting their Make Payment functionality. This functionality is critical and due to this issue tuser cannot process the case further.
Error Messages
Not applicable.
Steps to Reproduce
Use the following function call and test during 12/27/2015 to 12/31/2015.
@(Pega-RULES:DateTime).CurrentDate("YYYYMMdd")
Root Cause
The ISO standard for time incorporates a "week year" that is used for fiscal year calculations.
It is implemented using an uppercase "Y" in format masks. For example, the mask of YYYYMMdd returns "week year" and this can result in a difference of +1 or -1 from the actual year. This issue appears in any software that subscribes to ISO standard, such as Java and Pega.
Resolution
Change the current mask from YYYYMMdd to yyyyMMdd.
Published January 31, 2016 - 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.