jsp页面中使用JSTL的fmt标签处理时间

原地址:https://blog.csdn.net/ylchou/article/details/7478793

时间对象转时间字符串:

        将时间后台传过来的时间对象转换为时间字符串,需要特别说明的是:参数必须是时间对象

<fmt:formatDate value="${receiveDate}" pattern="yyyy-MM-dd" ></fmt:formatDate>

时间字符串转时间对象:

        将后台传过来的时间字符串先转化为时间对象,然后转换为指定的时间字符串
<fmt:parseDate value="${limsSummaryVO.receiveDate}" pattern="yyyy-MM-dd" var="receiveDate"></fmt:parseDate>
<fmt:formatDate value="${receiveDate}" pattern="yyyy-MM-dd" ></fmt:formatDate>

猜你喜欢

转载自blog.csdn.net/HenryMrZ/article/details/80890129
今日推荐