This project is read-only.

SetDateTimeErro

Oct 15, 2010 at 5:14 AM

string  drValue="2010-09-10";

DateTime dateV;

 DateTime.TryParse(drValue, out dateV);

 newCell.SetCellValue(dateV);

then the value in excel is double type 40431

Oct 15, 2010 at 6:19 AM

click the cell erro alter:

2010-10-15

ischanged

=2010-10-15

the cell show1985 like compute 2010 - 10 - 15=1985

Oct 15, 2010 at 6:33 AM

TestingCode: 

protected void Button1_Click(object sender, EventArgs e)
        {
            Workbook xlWorkbook = new NPOI.HSSF.UserModel.HSSFWorkbook();
            Sheet xlSheet = xlWorkbook.CreateSheet();
            Row xlRow = xlSheet.CreateRow(0);
            Cell xlCell = xlRow.CreateCell(0);
            xlCell.SetCellType(NPOI.SS.UserModel.CellType.STRING);
            xlCell.SetCellValue("2010-10-15 10:55:00");
            //NPOI.SS.UserModel.Cell;
            //NPOI.HSSF.UserModel.HSSFCell;
            xlCell.ToString();
            System.IO.FileStream fs = new System.IO.FileStream("C:\\npoi-test.xls", System.IO.FileMode.Create);
            xlWorkbook.Write(fs);
            fs.Flush();
            fs.Close();
        }

Coordinator
Nov 9, 2010 at 12:04 AM

This bug will be fixed in NPOI 1.2.3 final release

Jan 19, 2012 at 6:24 AM

Seems it still exists in version 1.2.4, do you planing to release a new version?

Thanks in advance.