Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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())"


Published February 26, 2018 - Updated October 8, 2020

Was this useful?

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.

Did you find this content helpful?

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