当前位置:网站首页>JSTL tag: fmt:formatdate tag format Chinese standard time or timestamp

JSTL tag: fmt:formatdate tag format Chinese standard time or timestamp

2022-06-25 12:47:00 good_ good_ xiu

demand

You need to format the time parameter returned by the server , It's usually Sat Jan 29 2022 18:14:44 GMT+0800 ( China standard time ). Formatted as 2022-01-29 18:14:44

<!-- forEach Similar labels for loop , Loop traversal list,list Object alias in is demo -->
<c:forEach items="${page.list}" var="demo">
	<tr>
		<!--  Alias . Property to call and display the value  -->
		<td>
			${demo.name}
		</td>
		<td>
			<!-- value Value ,var Is the alias used for calling after formatting ,pattern Format for formatting  -->
			<fmt:formatDate value="${demo.beginDate}" var="beginDate" pattern="yyyy-MM-dd HH:mm:ss">
			<!--  call fmt:formatDate Time alias after label processing  -->
			${beginDate}
		</td>
	</tr>
</c:forEach>
原网站

版权声明
本文为[good_ good_ xiu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200526520355.html