Support Article
pxDay function displays incorrect value for DateTime property
SA-54547
Summary
pxDay function displays the incorrect value for the DateTime property.
Error Messages
Not Applicable
Steps to Reproduce
- Ensure that the operator time zone and Database or Application server time zone are different (for example: Operator time zone is America or New_York and Database or Application Server time zone is IST).
- Create a DateTime property.
- Expose the property.
- Create a work object and fill the DateTime property value as 28th March 10:00 PM.
- Create a report definition rule.
- Use the pxDay function to retrieve the date portion from the DateTime property.
Root Cause
This behavior is as per Pega product design.
pxDay rule is of Rule-Alias-Functions type. This works on database or AppServer time zone only. It does not convert the DateTime value from the database time zone to operator time zone.
On entering 28th March 10:00 PM for the DateTime property, the application converts it to database time zone and stores it in the corresponding exposed columns. In this case, value is now 1st April.
When pxDay function is used to retrieve the date portion from the DateTime property, 1st April is returned instead of 31st March as it does not convert to the operator time zone.
Resolution
As a local-change, write a custom Rule-Alias-Function to convert the DateTime value according to the operator time zone.
Published August 24, 2018 - 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.