jstl 强大的日期处理

来源:百度文库 编辑:神马文学网 时间:2024/06/05 02:21:39

jstl 强大的日期处理

 

JSP Standard Tag Libraries
Formatting and Internationalization
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.
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.)

Library import and parameter capturing:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>



The input parameters must match the patterns, or the JSP will thrown an exception. This page does no error handling.

Input parameters:
Date:    2004/04/01:13:30:00   Java format: Thu Apr 01 13:30:00 CST 2004
isoDate: 20040531T235959       Java format: Mon May 31 23:59:59 CDT 2004

Dates
Tag Output
Attribute: value; required. Tag has no body.


 2004-4-1 13:30:00  


 2004-5-31 23:59:59  
Attribute: type; optional. Indicates what to print: date, time, or both.


 2004-4-1  


 23:59:59  
Attribute: dateStyle; optional. Varies the date format.


 2004-5-31  


 04-5-31  


 2004-5-31  


 2004年5月31日  


 2004年5月31日 星期一  
Attribute: timeStyle; optional. Varies the time format.


 23:59:59  


 下午11:59  


 23:59:59  


 下午11时59分59秒  


 下午11时59分59秒 CDT  
Attribute: pattern; optional. Inidcates date/time custom patterns.


 星期四, 四月 1, 2004 13:30:00 -0600  
jstl 强大的日期处理 关于Java日期处理函数.[不断更新] - feng_sundy的专栏 - CSDNBlo... JSTL标签的使用 JSTL JSTL标签出错的解决方法. Struts和JSTL的结合 JSTL标签出错的解决方法. 综合整理之后的PowerDate .方便处理常日公历日期操作 vb 日期、数字格式处理1 推荐一篇关于JSTL的好文章 JSTL与Struts的结合(一) JSTL与Struts的结合(八) JSTL与Struts的结合(九) JSTL与Struts的结合(十) JSTL与Struts的结合(十一) JSF与JSTL的互操作问题 JSF与JSTL的互操作问题 感恩节的日期 cnBeta.COM_网络软件_ [多图] 七个强大实用的在线图片处理网站 c# 日期有关的函数 c# 日期有关的函数 mysql 关于日期的用法 Excel日期计算快速输入无规律的日期系列 SQLServer日期查询时的日期格式转换