Freemarker中时间的问题

时间:2024-03-19 11:13:27

FreeMarker template error (DEBUG mode; use RETHROW in production!): 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: ==> pageInfo.updateTime [in template "News/list.ftl" at line 36, column 35] ---- Tip: Use ?date, ?time, or ?datetime to tell FreeMarker the exact type. ---- Tip: If you need a particular format only once, use ?string(pattern), like ?string('dd.MM.yyyy HH:mm:ss'), to specify which fields to display. ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${pageInfo.updateTime} [in template "News/list.ftl" at line 36, column 33] ---- Java stack trace (for programmers): Freemarker中时间的问题

如上图箭头,需要把数据库传入的Date类型转换为String

 

Freemarker中时间的问题

修改为

Freemarker中时间的问题