JSTL fmt:formatDate 

Joined:
07/29/2009
Posts:
13

July 07, 2010 15:16:34    Last update: July 07, 2010 15:17:08
Example:
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:formatDate type="both" dateStyle="short" timeStyle="short" value="${notifyDateTime}"/>


Full attributes:
AttributeMeaning
valueDate object to be formatted
typeFormat time only ('time'), date only ('date'), or both date and time ('both')?
dateStyleStyle to format date, e.g., default, short, long, full etc (c.f. JavaDoc for java.text.DateFormat)
timeStyleStyle for format time, e.g., default, short, long, full etc (c.f. JavaDoc for java.text.DateFormat)
patternUser defined pattern, e.g., MM/dd/yyyy
timeZoneWhich time zone to display the date for?
varIf the var attribute is specified, then a String value containing the formatted date is assigned to the named variable. Otherwise, the <fmt:formatDate> tag will write out the formatting results.
scopeWhen the var attribute is present, the scope attribute specifies the scope of the resulting variable.

.
Share |
| Comment  | Tags