• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading date from excel file

 
Vijay Bhore
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I am trying to read a date from excel file.
The category of the column is General.
In the date value is stored as 20090625 which i want to interpret as 25th June 2009.

When i am trying to read and print this value in java class, i am getting a wrong value as mentioned in the below log,
input docDate in String Format : 2.0090625E7

I can use the String manipulation functions to format the date according to my requirement but i guess there will be more precise approach for this.

Kindly suggest me about the right approach to read a date from excel sheet.

Thanks and Regards,
Vijay Bhore
24632268
 
K. Tsang
Bartender
Posts: 3604
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there.

The so-called date is read in as an integer or long. You need to convert that into a string array to get the proper year, month and day. You can use Integer.toString(some_int) to make the data into a string. From here, you need to cater the output.

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!