如何使用 apache poi 以 mm/dd/yyyy 等 Excel 工作表日期格式打印确切的日期单元格值 [英] how to print the exact date cell value in the excel sheet date format like mm/dd/yyyy using apache poi
问题描述
我正在使用 apache poi 3.5 从 Excel 表格中提取数据.我的日期单元格格式为 mm/dd/yyyy.
I am using apache poi 3.5 for extracting data from the excel sheet.i having the date cell formatted in mm/dd/yyyy.
如果我使用 cell.getDateCellValue() 打印然后以其他格式打印日期.所以,我想打印 excel 表格单元格实际格式的日期.
If i print using cell.getDateCellValue() then print the date in other format.so, i want to print the date that is in the actual format of excel sheet cell.
我是怎么做的..请指导我怎么做..
how i do it..Please guide me way to do it....
沙拉湾
推荐答案
只需调用formatCellValue(Cell)
、formatCellValue(cell, formulaEvaluator)
方法>DataFormatter 类.它将打印 Excel 工作表中的值.
just call the method formatCellValue(Cell)
, formatCellValue(cell, formulaEvaluator)
in the DataFormatter
class. It will print the value as it is in the excel sheet.
formatCellValue(cell, formulaEvalator)
用于公式单元格...
formatCellValue(cell, formulaEvalator)
for formula cells...
这篇关于如何使用 apache poi 以 mm/dd/yyyy 等 Excel 工作表日期格式打印确切的日期单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!