﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-蜗牛的JAVA外壳-随笔分类-jstl</title><link>http://www.blogjava.net/unser/category/22760.html</link><description>┎Running Snail┒
┖ -------------- ┚</description><language>zh-cn</language><lastBuildDate>Thu, 24 May 2007 23:42:58 GMT</lastBuildDate><pubDate>Thu, 24 May 2007 23:42:58 GMT</pubDate><ttl>60</ttl><item><title>jstl格式化日期</title><link>http://www.blogjava.net/unser/archive/2007/05/24/119690.html</link><dc:creator>会跑的蜗牛</dc:creator><author>会跑的蜗牛</author><pubDate>Thu, 24 May 2007 04:05:00 GMT</pubDate><guid>http://www.blogjava.net/unser/archive/2007/05/24/119690.html</guid><wfw:comment>http://www.blogjava.net/unser/comments/119690.html</wfw:comment><comments>http://www.blogjava.net/unser/archive/2007/05/24/119690.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/unser/comments/commentRss/119690.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/unser/services/trackbacks/119690.html</trackback:ping><description><![CDATA[JSP Standard Tag Libraries<br>Formatting and Internationalization<br>Two form input parameters, 'date' and 'isoDate', are URL-encoded in the link leading to this page. 'isoDate' is formatted according to the ISO8601 standard. <br>Formatting of numbers and dates is based on the browser's locale setting. Formatting will change if you switch the default language setting from English to French or German, for example. (The browser needs to be restarted, too.) <br><br>Library import and parameter capturing:<br><br>&lt;%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %&gt;<br>&lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %&gt;<br><br>&lt;fmt:parseDate value="${param.date}" var="date" pattern="yyyy/MM/dd:HH:mm:ss&gt;<br>&lt;fmt:parseDate value="${param.isoDate}" var="isoDate" pattern="yyyyMMdd'T'HHmmss"&gt;<br><br>The input parameters must match the patterns, or the JSP will thrown an exception. This page does no error handling. <br><br>Input parameters:<br>Date: &nbsp; &nbsp;2004/04/01:13:30:00 &nbsp; Java format: Thu Apr 01 13:30:00 CST 2004<br>isoDate: 20040531T235959 &nbsp; &nbsp; &nbsp; Java format: Mon May 31 23:59:59 CDT 2004<br><br>Dates<br>Tag Output <br>Attribute: value; required. Tag has no body. <br>&lt;fmt:formatDate value="${date}" type="both"/&gt;<br><br>&nbsp;2004-4-1 13:30:00 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="both"/&gt;<br><br>&nbsp;2004-5-31 23:59:59 &nbsp;<br>Attribute: type; optional. Indicates what to print: date, time, or both. <br>&lt;fmt:formatDate value="${date}" type="date"/&gt;<br><br>&nbsp;2004-4-1 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="time"/&gt;<br><br>&nbsp;23:59:59 &nbsp;<br>Attribute: dateStyle; optional. Varies the date format. <br>&lt;fmt:formatDate value="${isoDate}" type="date" dateStyle="default"/&gt;<br><br>&nbsp;2004-5-31 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="date" dateStyle="short"/&gt;<br><br>&nbsp;04-5-31 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="date" dateStyle="medium"/&gt;<br><br>&nbsp;2004-5-31 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="date" dateStyle="long"/&gt;<br><br>&nbsp;2004年5月31日 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="date" dateStyle="full"/&gt;<br><br>&nbsp;2004年5月31日 星期一 &nbsp;<br>Attribute: timeStyle; optional. Varies the time format. <br>&lt;fmt:formatDate value="${isoDate}" type="time" timeStyle="default"/&gt;<br><br>&nbsp;23:59:59 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="time" timeStyle="short"/&gt;<br><br>&nbsp;下午11:59 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="time" timeStyle="medium"/&gt;<br><br>&nbsp;23:59:59 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="time" timeStyle="long"/&gt;<br><br>&nbsp;下午11时59分59秒 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="time" timeStyle="full"/&gt;<br><br>&nbsp;下午11时59分59秒 CDT &nbsp;<br>Attribute: pattern; optional. Inidcates date/time custom patterns. <br>&lt;fmt:formatDate value="${date}" type="both" pattern="EEEE, MMMM d, yyyy HH:mm:ss Z"/&gt;<br><br>&nbsp;星期四, 四月 1, 2004 13:30:00 -0600 &nbsp;<br>&lt;fmt:formatDate value="${isoDate}" type="both" pattern="d MMM yy, h:m:s a zzzz/&gt;<br><br>&nbsp;31 五月 04, 11:59:59 下午 中央夏令时
<img src ="http://www.blogjava.net/unser/aggbug/119690.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/unser/" target="_blank">会跑的蜗牛</a> 2007-05-24 12:05 <a href="http://www.blogjava.net/unser/archive/2007/05/24/119690.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>