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

Incorrect date parsing in xlsx files to Sat, 15 Jul 1905 #593

Open
Ankush-yubi opened this issue Jun 7, 2023 · 2 comments
Open

Incorrect date parsing in xlsx files to Sat, 15 Jul 1905 #593

Ankush-yubi opened this issue Jun 7, 2023 · 2 comments

Comments

@Ankush-yubi
Copy link

Steps to reproduce

xlsx = Roo::Excelx.new("./date_file.xlsx")
xlsx.each_row_streaming do |row|
puts row.inspect
end

Issue

#<Roo::Excelx::Cell::Date:0x00000001320b7ba0 @cell_value="2023-11-01", @cell_type=[:numeric_or_formula, "yyyy\-mm\-dd"], @coordinate=[7, 6], @value=Sat, 15 Jul 1905, @Format="yyyy\-mm\-dd", @Style=8>

2023-11-01 value incorrectly parsed to Sat, 15 Jul 1905.

System configuration

Roo version: (2.9.0)
Ruby version: 3.0.4

@ssunday
Copy link

ssunday commented Jun 20, 2023

Also experiencing

@1990eam
Copy link

1990eam commented Nov 2, 2023

Don't know if it's related but I'm also having an issue where 08/04/2023 is parsed as 2023-04-08. Why and how could it be prevented?

Edit: found where the string is casted to a Date object with the mentioned format in the gem files (lib/roo/excelx/cell.rb). Since it's already casting it into a Date object I'm just reformatting it again to the desired format.

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