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

Get cell value in custom date format #655

Closed
CezarGarrido opened this issue Jun 22, 2020 · 3 comments
Closed

Get cell value in custom date format #655

CezarGarrido opened this issue Jun 22, 2020 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@CezarGarrido
Copy link

CezarGarrido commented Jun 22, 2020

Hello, I'm using excel in a project with Windows, in the excel file there is a cell with a custom format following the following date pattern: 6/11/2020 17:39:36 PM.

When I search for the value of this cell using excelize, it returns a number for example 43993. I would like to know if there is any way to capture this cell value. I may be making a mistake.

go version go1.13.4 windows / amd64
github.com/360EntSecGroup-Skylar/excelize/v2 v2.2.0

@xuri
Copy link
Member

xuri commented Jun 30, 2020

Thanks for your issue. GetCellValue just supports get cell value with Excel's built-in formats number format currently. If it couldn't apply a number format of the cell value, it will return the raw value of the cell. Also reference #50 and #73.

@xuri xuri closed this as completed Jun 30, 2020
@xuri xuri added the duplicate This issue or pull request already exists label Jun 30, 2020
@dmint007
Copy link

dmint007 commented Sep 11, 2020

Thanks for your issue. GetCellValue just supports get cell value with Excel's built-in formats number format currently. If it couldn't apply a number format of the cell value, it will return the raw value of the cell. Also reference #50 and #73.

Then how can we fetch the date in the given cell?
I have a hard written date of 09/09/19 which GetCellValue() keeps returning as "43717.0"

v := excelize.parseTime(22, cellValue) is unexported.

@artiz
Copy link
Contributor

artiz commented Sep 17, 2020

Fixed in #703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants