Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Please help in converting double value to date..

807601Jan 22 2008 — edited Jan 27 2008
Hi Friends,
I have a double value which I am getting from reading the excel file using Apache POI Classes.
For example: The date in the excel cell is 12/18/2008 and when reading the cell using the POI class it is returning 39800.0
instead of returning the original excel date 12/18/2008.

Basically I need to convert back the double value 39800.0 to 12/18/2008.

Did anybody face issue like this, or is there any other way to get date value from excel files.

I am posting part of my code for reference..
//---------------------------------------------------------------------
public String getCellValues(HSSFCell cell) {
if (cell.getCellType()==0 ) {
return ""+cell.getNumericCellValue();
}
if (cell.getCellType()==1 ) {
return cell.getStringCellValue();
}
return "";
}
//--------------------------------------------------------------------

Thanks in Advance
James George.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2008
Added on Jan 22 2008
5 comments
1,398 views