最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

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

来源:动视网 责编:小采 时间:2020-11-27 21:18:26
文档

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 -06
推荐度:
导读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 -06



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

文档

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 -06
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top