apache poi excel hours format set cell value java -


i working on excel generation , did functionality in excel, 1 problem occurs. want set cell value hh:mm not date. have string 12:45,36:30,102:50. each cell but, want detect cells time format greater 24 hours in excel , if select cells, show sum of hours on excel. don't know how that. found similar post on stack ( hh:mm:ss xls reading using apache poi), post shows how read cells. want set cell value greater 24 hours format hours , minutes 25:00, 205:00, 152:30.

can me? appreciate effect!

promoting comment answer....

excel stores dates integer days since 1900 or 1904, depending on setting, ish... (there's leap year issues in there). excel stores times fractions of day. so, on 1900 window'd file, depending on format string used

0.1 = 02:24:00 0.5 = 12:00:00 1.5 = 1900-01-02 12:00:00 1.5 = 36:00:00 

so, if want store , display 36 hours, work out fraction of day (1.5), apply formatting string supports >36 hours. format hh:mm , you'll 12:00. format [hh]:mm , you'll 36:00

use excel work out format string need - poi writes format string give file, , excel renders if you'd written in excel!


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -