日期格式化标签<fmt:formatDate>&<fmt:setTimeZone>时区标签的使用demo


日期格式化标签<fmt:formatDate>&<fmt:setTimeZone>时区标签的使用demo

<%@ page contentType="text/html" pageEncoding="GBK"%>
<%@ page import="java.util.*"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
  <head><title>国际化标签库</title></head>	
  <body>
  	<%
  	pageContext.setAttribute("date",new Date());
  	%>
  <fmt:setTimeZone value="MET"/>
  	<fmt:formatDate value="${date}" type="both" dateStyle="full" timeStyle="full" var="dateref"/>
  	<h3>中欧时间:${dateref}</h3>
  </body>
</html>


运行结果:


中欧时间:2013年8月26日 星期一 上午10时59分36秒 MEST

原文地址:https://www.cnblogs.com/riskyer/p/3283589.html