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

value from datetime format cell is wrong #1112

Closed
dw130 opened this issue Jan 4, 2022 · 6 comments
Closed

value from datetime format cell is wrong #1112

dw130 opened this issue Jan 4, 2022 · 6 comments

Comments

@dw130
Copy link

dw130 commented Jan 4, 2022

image
image

use GetRows function
read value is 44087

golang 16
excelize version: v2.5.0

@dw130
Copy link
Author

dw130 commented Jan 4, 2022

@xuri

@xuri
Copy link
Member

xuri commented Jan 4, 2022

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.

@eqinox76
Copy link

eqinox76 commented Jan 4, 2022

In the meantime i think you have to convert the date via excelize.ExcelDateToTime as 44087 is a correct excel date see here.

@dw130
Copy link
Author

dw130 commented Jan 5, 2022

@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

@xuri
Copy link
Member

xuri commented Jan 11, 2022

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.

xuri added a commit that referenced this issue Feb 12, 2022
- Introduced NFP (number format parser) dependencies module
- Initialize custom dates and times number format support
- Dependencies module upgraded
xuri added a commit to carbin-gun/excelize that referenced this issue Oct 9, 2022
…is improve number format support

- Introduced NFP (number format parser) dependencies module
- Initialize custom dates and times number format support
- Dependencies module upgraded
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
…is improve number format support

- Introduced NFP (number format parser) dependencies module
- Initialize custom dates and times number format support
- Dependencies module upgraded
@xuri
Copy link
Member

xuri commented Nov 1, 2023

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.

@xuri xuri closed this as completed Nov 1, 2023
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

3 participants