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 Date Cell Value #1133

Closed
AngangGuo opened this issue Jan 29, 2022 · 2 comments
Closed

Get Date Cell Value #1133

AngangGuo opened this issue Jan 29, 2022 · 2 comments

Comments

@AngangGuo
Copy link

I formatted the date cell 1/5/2022 as 1/5. When the cursor moved to the E1 cell, I can see the actual value is 1/5/2022 in the formula bar as shown in the following picture.

image

When I read the cell value using Excelize, it shows 1/5.

s, _ := f.GetCellValue("Sheet1", "E1")
// print 1/5 instead of 1/5/2022
fmt.Println(s)

How can I read it as date 1/5/2022?
or as a number as in #1112 ?

Thanks

@xuri
Copy link
Member

xuri commented Jan 29, 2022

Thanks for your issue. The library support parsing build-in date and time number format under English (United States), and doesn't support custom number format currently, you can convert cell value to time.Time by reference example in issue #1126.

@AngangGuo
Copy link
Author

It works.
Great thanks.

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
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