Support Article
Time format does not work when List View is exported to excel
SA-10749
Summary
The requirement is to show date and time in different columns. User has used two different columns - Date and time control to display respecive fields.
It works fine from front end, but during exporting to excel in time field it shows one date "1/0/1900".
Error Messages
No error message, but in front of time field one date is displayed - "1/0/1900"
Steps to Reproduce
1.Create one list view.
2. Use one date time property in two columns. in Format and Format to excel use date and time control. It works for UI but does not work for export to excel.
Root Cause:
The issue is the OOTB Time format does not work when we are trying to perform the export to excel of the list view, and it only show case the correct reslut on the UI of PRPC .
Resolution
1. Open the "Time" HTML Property rule instance on your system.
2. Perform a "Save As" of the HTML Property, specifying a new "Stream Name" and custom Ruleset and Ruleset version.
3. Update the new HTML property to add the code below as illustrated in the example screenshot.
(In the below div tag the style must be the format which you want to export to excel.)
<div class="excel-datetime" style="vnd.ms-excel.numberformat:@">
{existing code}
</div>
4. Use this New Control in the Export to Excel format.
5. Save the rule and execute the report and let me know if you have any issues.
Published July 29, 2015 - 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.