Date formatting in ClosedXML

I have a date on an excel sheet that I am reading. I like to make the date be in mm / dd / yyyy Is there a way to do this in closed XML.

I looked at https://closedxml.codeplex.com/documentation , but could not find how to force or update the date to a specific format.

+5
source share
1 answer

If you want to do this on a special cell, you should use

worksheet.Cell(row,column).Style.NumberFormat.Format = "mm/dd/yyyy"; 

and

If you want to do this on multiple cells, you should use

 worksheet.Range(row,column,row,column).Style.NumberFormat.Format = "mm/dd/yyyy"; 
+6
source

All Articles