【发布时间】:2017-02-13 02:41:27
【问题描述】:
我是 Java/Spring/Thymeleaf 的新手,所以请忍受我目前的理解水平。我确实查看了this similar question,但无法解决我的问题。
我正在尝试获取简化的日期而不是长日期格式。
// DateTimeFormat annotation on the method that's calling the DB to get date.
@DateTimeFormat(pattern="dd-MMM-YYYY")
public Date getReleaseDate() {
return releaseDate;
}
html:
<table>
<tr th:each="sprint : ${sprints}">
<td th:text="${sprint.name}"></td>
<td th:text="${sprint.releaseDate}"></td>
</tr>
</table>
电流输出
sprint1 2016-10-04 14:10:42.183
【问题讨论】:
标签: java spring-boot thymeleaf datetime-format