小白教程
所有教程
关于
Search
172.70.100.205
172.70.100.205
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Jstl format timezone tag”的源代码
本页内容
上一节:
Jstl_format_setbundle_tag
下一节:
Jstl_format_settimezone_tag
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:<fmt:timeZone>}}[[Category:jsp jstl|22]] = <fmt:timeZone> 标签 = [[jsp jstl|JSP 标准标签库]] <fmt:timeZone>标签用来指定时区,供其它标签使用。 === 语法格式 === <sample title="" desc="" lang="jsp" hererun="1"> <fmt:setLocale value="<string>" variant="<string>" scope="<string>"/> </sample> === 属性 === <fmt:timeZone>标签有如下属性: {| class="table table-striped table-hover" ! '''属性''' ! '''描述''' ! '''是否必要''' ! '''默认值''' |- | value | 时区 | 是 | 无 |} == 实例演示 == <sample title="" desc="" lang="jsp" hererun="1"> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <html> <head> <title>JSTL fmt:timeZone 标签</title> </head> <body> <c:set var="now" value="<%=new java.util.Date()%>" /> <table border="1" width="100%"> <tr> <td width="100%" colspan="2" bgcolor="#0000FF"> <p align="center"> <b> <font color="#FFFFFF" size="4">Formatting: <fmt:formatDate value="${now}" type="both" timeStyle="long" dateStyle="long" /> </font> </b> </p> </td> </tr> <c:forEach var="zone" items="<%=java.util.TimeZone.getAvailableIDs()%>"> <tr> <td width="51%"> <c:out value="${zone}" /> </td> <td width="49%"> <fmt:timeZone value="${zone}"> <fmt:formatDate value="${now}" timeZone="${zn}" type="both" /> </fmt:timeZone> </td> </tr> </c:forEach> </table> </body> </html> </sample> 运行结果如下: [[jsp jstl|JSP 标准标签库]]
返回至“
Jstl format timezone tag
”。
上一节:
Jstl_format_setbundle_tag
下一节:
Jstl_format_settimezone_tag