Skip to main content

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

  1. Create a Report Definition with DateTime column.
  2. Mention the Column formatting as Date Time.
  3. 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())"


Suggest Edit

Published February 26, 2018 - Updated October 8, 2020

Did you find this content helpful? Yes No

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us