You can try the following:
First set the format in the cell:
ws.Cells[1,1].Style.Numberformat.Format = "yyyy/MM/dd";
Then set the value as DateTime:
workSheet.Cells[1, 1] =new DateTime(2012,9,20);
And to get the value use the following:
double d = double.Parse(workSheet.Cells[1, 1].value()); DateTime conv = DateTime.FromOADate(d);
รญgor source share