FreeMarker 日期转换失败

FreeMarker 日期转换失败

Can't convert the date-like value to string because it isn't known if it's a date (no time part), time or date-time value. The blamed expression:

错误原因:无法将日期(Date)转换为字符串(String)

解决方案:将日期格式化

//1.年月日时分秒格式
<td>${orderDTO.createTime?string("yyyy-MM-dd HH:mm:ss")}</td>
//2.年月日格式
<td>${orderDTO.createTime?string("yyyy-MM-dd")}</td>
posted @ 2021-03-10 17:35  Godwin_Zhang  阅读(334)  评论(1编辑  收藏  举报