Support Article
Date Format in exported Excel differs from report date format
SA-45147
Summary
When exporting content to Excel, the date format in the exported Excel is different from the Report Definition date format.
For example,
Date format in the Report Definition: MM/dd/yyyy hh:mm AM/PM
Date format in the exported Excel: MM-dd-yyyy hh:mm:ss
Error Messages
Not Applicable
Steps to Reproduce
- Create a Report Definition with DateTime column.
- Mention the Column formatting as Date Time.
- Run the report and export the content to Excel using the 'Export to Excel' option.
Root Cause
A defect in Pegasystems’ code or rules:
The Export_DateTime control formats the Date Time into the PRDateFormat.DEFAULT_DATETIME_SHORT format.
Resolution
Perform the following local-change:
Override the Export_DateTime control in an application ruleset. Modify the below setting,
"sDatetime = PRDateFormat.format(null, strTimeZone, PRDateFormat.DEFAULT_DATETIME_SHORT, curProp.toDate())"
to
"sDatetime = PRDateFormat.format(null, strTimeZone, "MM/dd/yyyy hh:mm a", curProp.toDate())"
Published February 26, 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.