<fmt:formatDate>标签的输出格式:
<fmt:formatDate>标签的输出格式:
d 月中的某一天。一位数的日期没有前导零。
dd 月中的某一天。一位数的日期有一个前导零。
ddd 周中某天的缩写名称,在 AbbreviatedDayNames 中定义。
dddd 周中某天的完整名称,在 DayNames 中定义。
M 月份数字。一位数的月份没有前导零。
MM 月份数字。一位数的月份有一个前导零。
MMM 月份的缩写名称,在 AbbreviatedMonthNames 中定义。
MMMM 月份的完整名称,在 MonthNames 中定义。
y 不包含纪元的年份。如果不包含纪元的年份小于 10,则显示不具有前导零的年份。
yy 不包含纪元的年份。如果不包含纪元的年份小于 10,则显示具有前导零的年份。
yyyy 包括纪元的四位数的年份。
gg 时期或纪元。如果要设置格式的日期不具有关联的时期或纪元字符串,则忽略该模式。
h 12 小时制的小时。一位数的小时数没有前导零。从1到12,分上下午 范围:01:00 AM~12:59AM
hh 12 小时制的小时。一位数的小时数有前导零。
H 24 小时制的小时。一位数的小时数没有前导零。从0到23,范围:00:00 AM~23:59AM
HH 24 小时制的小时。一位数的小时数有前导零。
m 分钟。一位数的分钟数没有前导零。
mm 分钟。一位数的分钟数有一个前导零。
s 秒。一位数的秒数没有前导零。
ss 秒。一位数的秒数有一个前导零。
示例:index.jsp
显示结果:
{type:both} <fmt:formatDate value="<%=new Date() %>" type="both"/><!-- 2011-3-30 9:41:21 -->
<br/>
{type:date} <fmt:formatDate value="<%=new Date() %>" type="date"/><!-- 2011-3-30 -->
<br/>
{type:time} <fmt:formatDate value="<%=new Date() %>" type="time"/><!-- 9:44:44 -->
<br/>
{type:date, dateStyle:default} <fmt:formatDate value="<%=new Date() %>" type="date" dateStyle="default"/><!-- 2011-3-30 -->
<br/>
{type:date, dateStyle:short} <fmt:formatDate value="<%=new Date() %>" type="date" dateStyle="short"/><!-- 11-3-30 -->
<br/>
{type:date, dateStyle:medium} <fmt:formatDate value="<%=new Date() %>" type="date" dateStyle="medium"/><!-- 2011-3-30 -->
<br/>
{type:date, dateStyle:long} <fmt:formatDate value="<%=new Date() %>" type="date" dateStyle="long"/><!-- 2011年3月30日 -->
<br/>
{type:date, dateStyle:full} <fmt:formatDate value="<%=new Date() %>" type="date" dateStyle="full"/><!-- 2011年3月30日 星期三 -->
<br/>
{type:time, timeStyle:default} <fmt:formatDate value="<%=new Date() %>" type="time" timeStyle="default"/><!-- 10:01:32 -->
<br/>
{type:time, timeStyle:short} <fmt:formatDate value="<%=new Date() %>" type="time" timeStyle="short"/><!-- 上午10:01 -->
<br/>
{type:time, timeStyle:medium} <fmt:formatDate value="<%=new Date() %>" type="time" timeStyle="medium"/><!-- 10:01:32 -->
<br/>
{type:time, timeStyle:long} <fmt:formatDate value="<%=new Date() %>" type="time" timeStyle="long"/><!-- 上午10时01分32秒 -->
<br/>
{type:time, timeStyle:full} <fmt:formatDate value="<%=new Date() %>" type="time" timeStyle="full"/><!-- 上午10时01分32秒 CST -->
<br/>
{type:both, pattern:EEEE, MMMM d, yyyy HH:mm:ss Z} <fmt:formatDate value="<%=new Date() %>" type="both" pattern="EEEE, MMMM d, yyyy HH:mm:ss Z"/><!-- 星期三, 三月 30, 2011 10:01:32 +0800 -->
<br/>
{type:both, pattern:d MMM yy, h:m:s a zzzz} <fmt:formatDate value="<%=new Date() %>" type="both" pattern="d MMM yy, h:m:s a zzzz"/><!-- 30 三月 11, 10:1:32 上午 中国标准时间 -->
<br/>
{pattern:dd/MM/yyyy HH:mm aa}} <fmt:formatDate value="<%=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2011-3-30 13:12:12") %>" pattern="dd/MM/yyyy HH:mm aa"/><!-- 30/03/2011 13:12 下午 -->
<br/>
{pattern:dd/MM/yyyy hh:mm aa} <fmt:formatDate value="<%=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2011-3-30 13:12:12") %>" pattern="dd/MM/yyyy hh:mm aa"/><!-- 30/03/2011 01:12 下午 -->
{type:both} 2011-3-30 10:07:42
{type:date} 2011-3-30
{type:time} 10:07:42
{type:date, dateStyle:default} 2011-3-30
{type:date, dateStyle:short} 11-3-30
{type:date, dateStyle:medium} 2011-3-30
{type:date, dateStyle:long} 2011年3月30日
{type:date, dateStyle:full} 2011年3月30日 星期三
{type:time, timeStyle:default} 10:07:42
{type:time, timeStyle:short} 上午10:07
{type:time, timeStyle:medium} 10:07:42
{type:time, timeStyle:long} 上午10时07分42秒
{type:time, timeStyle:full} 上午10时07分42秒 CST
{type:both, pattern:EEEE, MMMM d, yyyy HH:mm:ss Z} 星期三, 三月 30, 2011 10:07:42 +0800
{type:both, pattern:d MMM yy, h:m:s a zzzz} 30 三月 11, 10:7:42 上午 中国标准时间
{pattern:dd/MM/yyyy HH:mm aa} 30/03/2011 13:12 下午
{pattern:dd/MM/yyyy hh:mm aa} 30/03/2011 01:12 下午
<fmt:formatDate>标签的输出格式:的更多相关文章
- fmt:formatDate标签的输出格式
http://blog.csdn.net/lidawei201/article/details/7197834
- jstl <fmt:formatDate>标签
<fmt:formatDate>标记用于在各种不同的方式来格式化日期 属性: <fmt:formatDate>标签具有以下属性: 属性 描述 必需 默认值 value 要显示的 ...
- <fmt:formatDate> 标签,日期格式化问题(Day_24)
一个时间显示问题,出生日期显示应为: yyyy-MM-dd,却显示: GMT格式(Wed Jun 15 00:00:00 CST 1983) 解决方案: 将图一改为图二. 图一: 图二: 最后: 注意 ...
- JSP标签 <fmt:formatDate>格式化日期
<fmt:formatDate>标签用于使用不同的方式格式化日期. <%@ page language="java" contentType="text ...
- (2)JSTL的fmt国际化标签库
format标签库:做国际化格式化,分两类 : 国际化核心标签:<fmt:setLocale>.<fmt:bundle>.<fmt:setBundle>.<f ...
- 日期格式化标签<fmt:formatDate>&<fmt:setTimeZone>时区标签的使用demo
日期格式化标签<fmt:formatDate>&<fmt:setTimeZone>时区标签的使用demo <%@ page contentType="t ...
- input标签和fmt:formatDate 在jsp中同时使用引号解决办法
input标签和fmt:formatDate 在jsp中同时使用引号解决办法 使用input标签设置默认值value并格式化fmt时间格式处理 格式化前: <input type="d ...
- Jsp页显示时间标签JSTL标签 <fmt:formatDate/> 实例大全
<fmt:formatDate value="${isoDate}" type="both"/>2004-5-31 23:59:59 <fmt ...
- jstl标签的fmt:formatDate格式化日期 String to Date
使用fmt函数需在jsp中引入 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" ...
随机推荐
- jQuery获取多种input值的方法
1 if($("input[name=item][value='val']").attr('checked')==true) //判断是否已经打勾 name即控件name属性,va ...
- MySql中常用的hint
对于经常使用Oracle的朋友可能知道,oracle的hint功能种类很多,对于优化sql语句提供了很多方法.同样,在MySQL里,也有类似的hint功能.下面介绍一些常用的. 强制索引 FORCE ...
- 在CentOS中将/var等已有目录挂载到新添加的硬盘
1.查看当前硬盘使用状况: [root@gluster_node1 ~]# df -h Filesystem Size Used Avail Use% Mounted on / ...
- [2016.08.09]文本替换专家 v5.2
软件名称:文本替换专家最新版本:v5.2软件授权:共享软件发布日期:2016.01.18文件大小:650KB操作系统:XP/2003/Win7/Win2008开发人员:胡洪祥版权所有:胡洪祥
- chart.js插件生成折线图时数据普遍较大时Y轴数据不从0开始的解决办法[bubuko.com]
chart.js插件生成折线图时数据普遍较大时Y轴数据不从0开始的解决办法,原文:http://bubuko.com/infodetail-328671.html 默认情况下如下图 Y轴并不是从0开始 ...
- Using dojo/query(翻译)
In this tutorial, we will learn about DOM querying and how the dojo/query module allows you to easil ...
- js点击后将文字复制到剪贴板,将图片复制到剪贴板
复制文字: <table width="99%" border="0" cellpadding="0" cellspacing=&qu ...
- codeforces 645 E. Intellectual Inquiry
一个字符串,由前k个字母组成,长度为m + n,其中前m个字符已经确定,后面n个由你自由选择, 使得这个串的不同的子序列的个数最多,空串也算一个子序列. 1 <= m <= 10^6,0 ...
- 样式hack
1.CSS 重置 html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, ...
- Google公布了禁用Chrome插件后的新解决方案
chrome://flags/#enable-npapi 启用npapi后重启chrome,再打开 chrome://plugins/