format.jsp

来自「达内JAVA培训-WEB课程部分项目源代码」· JSP 代码 · 共 21 行

JSP
21
字号
<%@page contentType="text/html;charset=gbk"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:useBean id="now" class="java.util.Date" />
<fmt:setLocale value="zh_CN" />
<li> Formatting current date as "GMT":<br>
	<fmt:timeZone value="GMT">
		<fmt:formatDate value="${now}" type="both" dateStyle="full" timeStyle="full"/>
	</fmt:timeZone>
<li> Formatting current date as "GMT+1:00", and parsing
its date and time components:<br>
<fmt:timeZone value="GMT+1:00">
	<fmt:formatDate value="${now}" type="both" dateStyle="full"
	timeStyle="full" var="formatted"/>
	<fmt:parseDate value="${formatted}" type="both" dateStyle="full"
	timeStyle="full" var="parsedDateTime"/>
	Parsed date: <fmt:formatDate value="${parsedDateTime}" type="date"
	dateStyle="full"/><br>
	Parsed time: <fmt:formatDate value="${parsedDateTime}" type="time"
	timeStyle="full"/>
</fmt:timeZone>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?