日期格式化标签<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>
运行结果: