(1)日期类型,若为Date类型(不带时分秒),则在返回实体Vo或Dto中,加入注解@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
(2)表中是dateTime,导出Excel的实体类中,可以是private String startDate;
(3)Date和String之间的转换:
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); dto.setOutStockDate(simpleDateFormat.format(entity.getOutStockDate()));