You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Alexander Groiss [P.A.S.T.]" <al...@past-research.com> on 2005/03/03 22:33:48 UTC
problem with duration/time format in hssf
Hi,
excel provides duration/time formats like "mm:ss.0".
I use setDataFormat(HSSFDataFormat.getBuiltinFormat("mm:ss.0")) and
pass a calendar object to the setCellValue() method.
My problem now is that i have date informations then (like 27.11.2003 00:00:01) and a "mm:ss.0" cell format in excel.
But for me its important to accumulate this duration datas.
Excel accumulates the whole date object.
Is it possible to pass it without the date component.
Thanks for any help
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
Re: problem with duration/time format in hssf
Posted by Alex Karshakevich <al...@thoughtspeed.biz>.
Can you subtract away the date from your Calendar and be left with only
the time component? Set the date to 1 January 1970.
Alex.
Alexander Groiss [P.A.S.T.] wrote:
>Hi,
>
>excel provides duration/time formats like "mm:ss.0".
>I use setDataFormat(HSSFDataFormat.getBuiltinFormat("mm:ss.0")) and
>pass a calendar object to the setCellValue() method.
>My problem now is that i have date informations then (like 27.11.2003 00:00:01) and a "mm:ss.0" cell format in excel.
>But for me its important to accumulate this duration datas.
>Excel accumulates the whole date object.
>Is it possible to pass it without the date component.
>
>Thanks for any help
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>Mailing List: http://jakarta.apache.org/site/mail2.html#poi
>The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/