ahmedwalid05 / FastExcel

Fast Excel Reading and Writing in .Net
MIT License
335 stars 98 forks source link

Date format? #33

Closed DanteNahuel closed 3 years ago

DanteNahuel commented 6 years ago

When the worksheet is readed, the cells formated as complete Dates return an odd number (43115.47584490741 e.g) and are of String type. How do I convert these into dates?

ivcubr commented 6 years ago

@DanteNahuel What is the format of the cell you are trying to read?

Can you post a sample Excel document and your code that is reading that cell?

linkosoft commented 5 years ago

I'm having the same problem

var worksheet1 = fastExcel.Read(1); FastExcel.CellRange cellRange = new FastExcel.CellRange("A", "BB"); var cells = worksheet1.GetCellsInRange(cellRange); var cellValue= cells.FirstOrDefault(x => x.RowNumber == 1 && x.ColumnNumber == 1).Value; var date = Convert.ToDateTime(cellValue);

skycloudnest commented 5 years ago

same problem

rstm-sf commented 4 years ago

This SO may help you. I think that additional processing should be added to this library.

ahmedwalid05 commented 3 years ago

Opened a new issue for this #58.