Support Article
Incorrect date retrieved for CurrentDateTime function
SA-71788
Summary
Incorrect date is retrieved when using the below function.
.pyLabel -- @DateTime.FormatDateTime(@DateTime.CurrentDateTime(),"dd-MMM-YY","","")+" 00:00:00"
For example,
The function retrieves 31 DEC 19 instead of 31 DEC 18.
This function is used in a property-set in an activity and the value is set to the .pylabelToday property.
Error Messages
Not Applicable
Steps to Reproduce
Not Applicable
Root Cause
A defect in Pegasystems’ code or rules.
Resolution
Perform the following local-change:
Use 'dd-MMM-yy' instead of 'dd-MMM-YY' in the below string to set the pyLabel property.
@DateTime.FormatDateTime(@DateTime.CurrentDateTime(),"dd-MMM-YY","","")+" 00:00:00"
Published January 23, 2019 - 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.