您好,欢迎来到度乐财经。
搜索
您的当前位置:首页fmt:formatDate的输出格式详解_javascript技巧

fmt:formatDate的输出格式详解_javascript技巧

来源:度乐财经



2004-5-31 23:59:59


2004-4-1


23:59:59


2004-5-31


04-5-31


2004-5-31


2004年5月31日


2004年5月31日 星期一


23:59:59


下午11:59


23:59:59


下午11时59分59秒


下午11时59分59秒 CDT


星期四, 四月 1, 2004 13:30:00 -0600

h 12 小时制的小时。一位数的小时数没有前导零。
hh 12 小时制的小时。一位数的小时数有前导零。
H 24 小时制的小时。一位数的小时数没有前导零。
HH 24 小时制的小时。一位数的小时数有前导零。
m 分钟。一位数的分钟数没有前导零。
mm 分钟。一位数的分钟数有一个前导零。
s 秒。一位数的秒数没有前导零。
ss 秒。一位数的秒数有一个前导零。

对于0点显示的结果不一样

要求${date}为date类型如果为String 就用document.write("${l.inputDate}".substring(0, 10));

<%@ page language="java" contentType="text/html; charset=gb18030"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


My JSP 'fmt.jsp' starting page





currency:

percent:





full-->

long-->

medium-->

default-->

short-->


今天是:

现在是:
结果:
今天是:公元 2007年10月19日 星期五
现在是:下午 20:04:11.484 CST

<%@ 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

Copyright © 2019- dules.cn 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务