excelize
excelize copied to clipboard
value from datetime format cell is wrong
use GetRows function read value is 44087
golang 16 excelize version: v2.5.0
@xuri
Thanks for your feedback, this issue is similar to #1093, the library support parsing build-in date and time number format under English (United States) currently, and I'll consider implementing number format lexer and parser to support multi-language location and custom number format.
In the meantime i think you have to convert the date via excelize.ExcelDateToTime
as 44087 is a correct excel date see here.
@xuri Is there any way to fetch the raw value current now ? I use the GetCellType function, return value is CellTypeUnset CellType If the GetCellType returns right value (CellTypeDate), I can use excelize.ExcelDateToTime function But GetCellType seems not work
Hi @dw130, please specify RawCellValue
field as true
in the options of the GetCellValue
, GetRows
or rows/columns iterator, and reference details about the result of GetCellType
in this comment of the issue.
Hi @dw130, @eqinox76, the excelize library improvements for reading cell value with number format in the recently released version. Please upgrade to the lasted version or use the master branch code. The date time cell result can be read correctly. I closed this issue. If you have any questions, please let me know, and you can reopen this anytime.