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/yyyyhh:mm AM/PM
Date format in the exported Excel: MM-dd-yyyyhh: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/yyyyhh:mm a", curProp.toDate())"


Published February 26, 2018 - Updated October 8, 2020


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.