Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ivantextmagic opened this issue Aug 27, 2024 · 0 comments
Open

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

ivantextmagic opened this issue Aug 27, 2024 · 0 comments

Comments

@ivantextmagic
Copy link

ivantextmagic commented Aug 27, 2024

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

@ivantextmagic ivantextmagic changed the title Date 02/08/2024 converts to dd/08/yyyy Date 02/08/2024 converts to dd/33/yyyy Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant