How to format Excel Cell as Date in Apache POI as with the Format Painter operation in Excel
- 阅读更多 关于 How to format Excel Cell as Date in Apache POI as with the Format Painter operation in Excel
问题 I am pretty new to Apache POI, I wonder how to do that Format Painter operation to format a cell into Date format, each time when I try to copy the date format of cell, in POI, it can only give me Numeric, I wonder how can I keep the date format? // Get source cell type and style CellType type_from = cell_from.getCellTypeEnum(); CellStyle style_from = cell_from.getCellStyle(); // Get source cell data format short df = style_from.getDataFormat(); // Change dest cell cell type, set format on it