>  기사  >  웹 프론트엔드  >  fmt:formatDate的输出格式详解_javascript技巧

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

WBOY
WBOY원래의
2016-05-16 17:04:41942검색


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 就用

<script>document.write("${l.inputDate}".substring(0, 10));</script>






My JSP 'fmt.jsp' starting page





currency:

percent:





full-->

long-->

medium-->

default-->

short-->


今天是:

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


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

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.