I am using the following code to add a DateTime
to a column in my spreadsheet:
var dt = DateTime.Now;
r.AppendChild(new Cell()
{
|
As an example you can create your own excel file with date column. Then if you open it with Productivity Tool from Open XML SDK you will find there is no DataType
specified for the cell with date value. This means that you should omit DataType
when creating date cell. In this case it is also required to pass dt.ToOADate().ToString()
as a cell value.