Heim  >  Artikel  >  Web-Frontend  >  fmt:formatDate的输出格式详解_javascript技巧

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

WBOY
WBOYOriginal
2016-05-16 17:04:41943Durchsuche


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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn