<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>标签的输出格式:的更多相关文章

  1. fmt:formatDate标签的输出格式

    http://blog.csdn.net/lidawei201/article/details/7197834

  2. jstl <fmt:formatDate>标签

    <fmt:formatDate>标记用于在各种不同的方式来格式化日期 属性: <fmt:formatDate>标签具有以下属性: 属性 描述 必需 默认值 value 要显示的 ...

  3. <fmt:formatDate> 标签,日期格式化问题(Day_24)

    一个时间显示问题,出生日期显示应为: yyyy-MM-dd,却显示: GMT格式(Wed Jun 15 00:00:00 CST 1983) 解决方案: 将图一改为图二. 图一: 图二: 最后: 注意 ...

  4. JSP标签 <fmt:formatDate>格式化日期

    <fmt:formatDate>标签用于使用不同的方式格式化日期. <%@ page language="java" contentType="text ...

  5. (2)JSTL的fmt国际化标签库

    format标签库:做国际化格式化,分两类 : 国际化核心标签:<fmt:setLocale>.<fmt:bundle>.<fmt:setBundle>.<f ...

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

    日期格式化标签<fmt:formatDate>&<fmt:setTimeZone>时区标签的使用demo <%@ page contentType="t ...

  7. input标签和fmt:formatDate 在jsp中同时使用引号解决办法

    input标签和fmt:formatDate 在jsp中同时使用引号解决办法 使用input标签设置默认值value并格式化fmt时间格式处理 格式化前: <input type="d ...

  8. Jsp页显示时间标签JSTL标签 <fmt:formatDate/> 实例大全

    <fmt:formatDate value="${isoDate}" type="both"/>2004-5-31 23:59:59 <fmt ...

  9. jstl标签的fmt:formatDate格式化日期 String to Date

    使用fmt函数需在jsp中引入 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" ...

随机推荐

  1. C# 多线程详解 Part.02(UI 线程和子线程的互动、ProgressBar 的异步调用)

           我们先来看一段运行时会抛出 InvalidOperationException 异常的代码段: private void btnThreadA_Click(object sender, ...

  2. CSRF攻击

    1.什么是CSRF攻击CSRF(Cross-site request forgery),跨站请求伪造.CSRF攻击的原理如下:1)用户登录正常的网站A后,在本地生成Cookie2)在不登出A的情况下, ...

  3. mysql操作记录

    use mysql;select host,user,password from user; grant all privileges on *.* to root@'%' identified by ...

  4. 【SharePoint学习笔记】第3章 SharePoint列表新特性以及数据访问

    第3章 SharePoint列表新特性以及数据访问   使用CAML查询语言     CAML:协作应用程序标记语言 Collaboration Application Markup Language ...

  5. ios 写项目的时候遇到的问题及解决方案(2)

    11.自适应文本高度 NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:]}; CGRect rec ...

  6. Discrete.Differential.Geometry-An.Applied.Introduction(sig2013) 笔记

    The author has a course on web: http://brickisland.net/DDGSpring2016/ It has more reading assignment ...

  7. jsgen 搭建

    1,mongodb 2,redis  http://www.cnblogs.com/lxx/archive/2013/06/04/3116985.html http://blog.csdn.net/w ...

  8. BMP头文件格式以及C语言读取头文件【转】

    BMP头文件格式以及C语言读取头文件[转] (2011-12-24 22:59:17) 转载▼ 标签: 杂谈 分类: 各个领域的知识 BMP图像文件由三部分组成:位图文件头数据结构,它包含BMP图像文 ...

  9. WMSWebServiceExtension 使用,支持压缩

    using System;using System.Collections.Generic;using System.IO.Compression;using System.Diagnostics;u ...

  10. Vs2015智能提示英文?

    Vs2015智能提示英文? 装了vs2015代码的智能提示全部变成英文了   找到这个目录 C:\Program Files (x86)\Reference Assemblies\Microsoft\ ...