We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Datetime format exports in 24hr format


I'm using following code while exporting data to excel.

Style columnStyle.Custom = "mm/dd/yyyy hh:mm";

StyleFlag columnStyleFlag.NumberFormat = true;

oSheet.Cells.ApplyColumnStyle(dataColumn.Ordinal, columnStyle, columnStyleFlag);

The datetime format is coming in 24hr format after exporting the data to excel.

For eg: 02/24/2010 00:00 instead of 02/24/2010 12:00 AM

Please let me know how can I change it to 12hr format.




Please use the following custom style to apply your desired display format of column.

columnStyle.Custom = "mm/dd/yyyy hh:mm AM/PM";

Thank You & Best Regards,