Commit 4d3b1f27 by fudahua

feat:时间格式

parent 1986ca18
package com.gic.cloud.data.hook.service;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CellStyle;
import java.util.Map;
public class ExcelUtil {
public static HSSFCellStyle getCellStyle(int type){
//时间日期
if (type==0) {
HSSFWorkbook demoWorkBook = new HSSFWorkbook();
HSSFCellStyle dateStyle = demoWorkBook.createCellStyle();
HSSFDataFormat format= demoWorkBook.createDataFormat();
dateStyle.setDataFormat(format.getFormat("yyyy-MM-dd HH:mm:ss"));
return dateStyle;
}else if (type ==1) {
}else if (type ==2) {
}
return null;
}
}
......@@ -975,7 +975,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
HSSFWorkbook demoWorkBook = new HSSFWorkbook();
HSSFCellStyle dateStyle = demoWorkBook.createCellStyle();
HSSFDataFormat format= demoWorkBook.createDataFormat();
dateStyle.setDataFormat(format.getFormat("yyyy-MM-dd HH:mm:ss"));
dateStyle.setDataFormat(format.getFormat("yyyy/MM/dd HH:mm:ss"));
// 遍历输出行
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment