Java – parsing large xlsx files, date format
•
Java
Because the xlsx file may contain millions of lines, I decided to use the POI event model to sample from here (example event user model), but I found some problems in parsing date format cells
For example, my excel date in cell A15 is 01.10 In 2011, but XML has:
<c r="A15" s="11"><v>40817</v></c>
It is not in date format, not even in milliseconds
How to parse the date of the event model?
Best wishes.
Solution
Excel stores the date as a floating-point number of days (and fractions of days) with a fixed starting point The value 40817 is the number of days from this starting point to October 1, 2011
The hssfcell of POI has a getdatecellvalue () method, which returns a Java date and will do what you want
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码