Excel date format using EPPlus

后端 未结 9 542
长情又很酷
长情又很酷 2020-12-18 17:44

I\'m having trouble with format my cells to Date.

FileInfo info = new FileInfo(path);
using (ExcelPackage package = new ExcelPackage(info))
{
      ExcelWork         


        
9条回答
  •  死守一世寂寞
    2020-12-18 18:01

    I agree with Yosoyke. You're probably targeting the wrong cells. You can try:

    ws.Cells["A3"].Style.Numberformat.Format = "yyyy-mm-dd";
    ws.Cells["A3"].Formula = "=DATE(2014,10,5)";
    

提交回复
热议问题