poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From terraInvader <jenze...@yahoo.de>
Subject HSSFCell format/converting problem
Date Thu, 14 Oct 2010 10:55:06 GMT

Hi out there,

I got a problem when trying to read an Excel-cell sensefully with HSSFCell.
My basic intension here is to combine the date & time cells for a
GregorianCalendar-Object:

http://apache-poi.1045710.n5.nabble.com/file/n3211882/cells.png 

Getting the string value of a date-cell was easy but I fail when trying to
get a useful time-value. The time-cell is Excel-internally formatted with
"custom": 

http://apache-poi.1045710.n5.nabble.com/file/n3211882/format.png 

When switching inside Excel to "General" or "Number" we get a double with
0,75 which is ok for 18:00 representing a fraction of time based on one day.

In my code I tried various formatting things, but whatever I do the cell
value "2.9803240299224854" is returned. 

cell.getDateCellValue().toString() or
DateUtil.getJavaDate(cell.getNumericCellValue()).toString()  return

Tue Jan 02 23:31:39 CET 1900.


Does anyone have an idea how to get a String with "18:00:00" or something
that could be processed sensefully?

Thank you very much for your cooperation,

best regards

Jens from Germany.


-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/HSSFCell-format-converting-problem-tp3211882p3211882.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message