Java XSSFSheet cannot get the correct date value

343
July 04, 2017, at 03:33 AM

Java XSSFSheet cannot get the correct date value.

It displays an invalid number.
I gave in excel as date: 9/24/2017

But while debugging the date displays as 43002

Please tell me the solution.

Answer 1

It evident from the screen shot that the date used in the excel and the date format to parse the same is not matching.

In order to solve the issue, make the following changes

  • Use the date in excel as 09/24/2017
  • In the class, change the date format as MM/dd/yyyy
Rent Charter Buses Company