Support Article
Day of function in Report Definition returns wrong day
SA-31245
Summary
Using the 'Day of' function on pyResolvedTimestamp returns wrong day in Report Definition
Error Messages
Not Applicable
Steps to Reproduce
- Create a Report Definition to report on resolved work items.
- In the Report Definition configure a column as Day of(.pyResolvedTimestamp).
- Resolve a work item such that its timestamp would fall in today as per server's local time and when converted to GMT it would fall in next day.
- Run the report and see that Day of(.pyResolvedTimestamp) returns next day while the item was resolved today.
Root Cause
Pega 7 stores the timestamp in GMT time in the blob. When a column is exposed the timestamp is stored in the local time of the server. If the data is read via an Obj-browse or Obj-open, the Engine does the proper conversion from GMT to local time. However in the ‘Day of’ function alias used in a Report Definition, it uses the timestamp stored in the local time of the server and may return an unexpected result.
Resolution
Perform the following local-change:
Create a function alias using the pxDay function alias and handle the conversion.
Published December 14, 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.