I have a c# program which needs to create an excel object, and do some operations, here are parts of my code:
// c# code:
workSheet.Cells[1, 1] = \"=2012/9/20\
You can try this:
First set the format in the cell:
ws.Cells[1,1].Style.Numberformat.Format = "yyyy/MM/dd";
Then set value as DateTime:
workSheet.Cells[1, 1] =new DateTime(2012,9,20);
And to get value use the following:
double d = double.Parse(workSheet.Cells[1, 1].value());
DateTime conv = DateTime.FromOADate(d);