Format Time cell in XLS

How do I create a cell with Time format?
Excel has to show “Time” format.
I use cells-java 21.7.


See the sample code for your reference.
Sample code:

        Workbook workbook = new Workbook();
        Worksheet worksheet = workbook.getWorksheets().get(0);
        worksheet.getCells().get("A1").putValue("11:12:20",  true);
        Style style = worksheet.getCells().get("A1").getStyle();
        style.setCustom("h:mm AM/PM");

        Style style1 = worksheet.getCells().get("A2").getStyle();

Also, see the document for your further reference:

Excel shows format for both cells as “Custom”, not “Time”.


Yes, we noticed it. We will evaluate it and get back to you soon.


We reproduced the issue as you mentioned. When opening the output file into MS Excel manually, it shows it as “Custom” instead of “Time”. We need to investigate your issue in details.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45268

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.