Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

tag

fmt:parseDate tag

JSP Standard Label LibraryJSP Standard Tag Library

fmt:parseDate The tag is used to parse a date.

Syntax format





property

fmt:parseDateThe tag has the following attributes:

property Description Whether it is required Default value
value The date to display Is None
type DATE, TIME, or BOTH No date
dateStyle FULL, LONG, MEDIUM, SHORT, or DEFAULT No default
timeStyle FULL, LONG, MEDIUM, SHORT, or DEFAULT No default
pattern A custom format pattern No None
timeZone The time zone in which to display the date No The default time zone
var The name of the variable that stores the formatted date No Display on the page
scope The scope for storing the formatted date variable No Page

The attribute sets the time format we need for the output.


Example Demonstration



<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

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

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







  JSTL fmt:parseDate 标签





日期解析:

解析后的日期为:

The result of the above example:

日期解析:



解析后的日期为: Tue Oct 20 00:00:00 CST 2015


JSP Standard Label LibraryJSP Standard Tag Library