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>
原文地址:https://www.cnblogs.com/XING-ZHI-JI-DA-XUE/p/14513142.html