Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: DateTime formatting

$
0
0
How can I get a date column to show date and time?

wb.Worksheets.FirstOrDefault().Column("B").Style.DateFormat.SetFormat("mm/dd/yyyy h:mm");

This format is working only for the date, but for the time it is always showing military time instead of 1-12 for the hours. I also want it to show PM or AM.

What am I doing wrong?

Viewing all articles
Browse latest Browse all 1877

Trending Articles