Skip to content

Date 02/08/2024 converts to dd/33/yyyy #36

@ivantextmagic

Description

@ivantextmagic

tried to parse simple xls file with date field, received this dd/33/yyyy
attached the file below, please, recheck

I used your code from ReadMe, with format, as described:

for _, cell := range row.GetCols() {
	xfIndex := cell.GetXFIndex()
	formatIndex := wb.GetXFbyIndex(xfIndex)
	format := wb.GetFormatByIndex(formatIndex.GetFormatIndex())
	cells = append(cells, format.GetFormatString(cell))
	
	fmt.Printf("Formatted: %v, String: %v, Type: %v\n", format.GetFormatString(cell), cell.GetString(), cell.GetType())
}

the output looks like this:

...
Formatted: dd/33/yyyy" "12:33, String: 45114.523253182866, Type: *record.Number
...

and this is xls file example:
wrong-date.xls

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions