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

Getting dates instead of numbers #73

Open
0syntrax0 opened this issue Sep 21, 2020 · 3 comments
Open

Getting dates instead of numbers #73

0syntrax0 opened this issue Sep 21, 2020 · 3 comments

Comments

@0syntrax0
Copy link

0syntrax0 commented Sep 21, 2020

I've been trying to get dates but instead I'm getting numbers. 1985-01-04T00:00:00Z | 1899-12-30T00:00:00Z.
The numbers are hardcoded, no formulas or anything.

Only strings are returned correctly.

if xlFile, err := Open("Table.xls", "utf-8"); err == nil {
		if sheet1 := xlFile.GetSheet(0); sheet1 != nil {
			col1 := sheet1.Row(0).Col(0)
			col2 := sheet1.Row(0).Col(0)
			for i := 0; i <= (int(sheet1.MaxRow)); i++ {
				row1 := sheet1.Row(i)
				col1 = row1.Col(0)
				col2 = row1.Col(1)

				fmt.Print("\n", col1, " | ", col2)
			}
		}
	}

image

@fatchul
Copy link

fatchul commented Mar 24, 2021

have you any solution for this? @0syntrax0

@0syntrax0
Copy link
Author

have you any solution for this? @0syntrax0

Well, it wasn't a pretty solution.
Since this file was sent by a customer, we decided to upload it to Google Docs and download it with a newer Excel version.
Which worked just fine.

@fatchul
Copy link

fatchul commented Mar 25, 2021

have you any solution for this? @0syntrax0

Well, it wasn't a pretty solution.
Since this file was sent by a customer, we decided to upload it to Google Docs and download it with a newer Excel version.
Which worked just fine.

hmm after I check, current issue at this line https://github.com/extrame/xls/blob/master/col.go#L85 . so I try to copy this package to my local env then I update this line, it works

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

2 participants