I'm trying to insert datetime value. It works, but when I open the excel file, in the column I see only date. To see time I must click on cell and look at the formula bar
DateTime valueDate = DateTime.Now;
string valueString = valueDate.ToOADate().ToString();
CellValue cellValue = new CellValue(valueString);
Cell cell = new Cell();
cell.DataType = new EnumValue<CellValues>(CellValues.Number);
cell.StyleIndex = 8;
cell.Append(cellValue);
My cell style:
new CellFormat()
{
BorderId = 1,
NumberFormatId = 14,
ApplyNumberFormat = true
}
I believe I should apply a custom style in my code somehow.