java 导入excel 日期格式转换
导入日期格式后 获取到的value值为 数值或小数值
直接上硬货
cell = row.getCell(4);
String go_time = getCellValue(cell);
map.put("go_time",go_time);
String go_time = map.get("go_time");
if (go_time.contains(".")){
go_time = getTime(go_time);
}else {
if (com.ota.airisa.order.StringUtils.isNotBlank(go_time)) {
Calendar c = new GregorianCalendar(1900, 0, -1);
Date d = c.getTime();
Date _d = DateUtils.addDays(d, Integer.parseInt(go_time));
go_time = df.format(_d);
}
}
if ("".equals(go_time)) {
go_time = null;
}
//带小数点的时间转换
//时间校验
//Mysql支持的时间戳限制
static long minTime = Timestamp.valueOf("1970-01-01 09:00:00").getTime();
static long maxTime = Timestamp.valueOf("2038-