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

New Post: DateTime-Format with /

$
0
0
Hi,
first: THANK YOU a lot for sharing this library! This library is just awesome!

i'm using sheet.Cell(2, 1).InsertData(IEnumerable<T>) for adding cell-informations. Some of the Cells are DateTime. We force all DateTimes to be like 31/10/2008.

so i added the following code to modify after the insert the DateFormat:
foreach (var cell in sheet.Range(1, 1, objectlist.Count() + 1, headers.Count).CellsUsed(c => c.DataType == XLCellValues.DateTime))
            {
                cell.Style.DateFormat.Format = "dd/MM/yyyy";
            }
this works well if i use "dd-MM-yyyy". But when i'll use dd/MM/yyyy, then it will be 12.01.2010 (like my current OS region info is).

Is there a way to force those '/'`?

Thank you for any tips...

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>