JSTL fmt:formatDate
July 07, 2010 15:16:34 Last update: July 07, 2010 15:17:08
Example:
Full attributes:
.
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> <fmt:formatDate type="both" dateStyle="short" timeStyle="short" value="${notifyDateTime}"/>
Full attributes:
| Attribute | Meaning |
|---|---|
| value | Date object to be formatted |
| type | Format time only ('time'), date only ('date'), or both date and time ('both')? |
| dateStyle | Style to format date, e.g., default, short, long, full etc (c.f. JavaDoc for java.text.DateFormat) |
| timeStyle | Style for format time, e.g., default, short, long, full etc (c.f. JavaDoc for java.text.DateFormat) |
| pattern | User defined pattern, e.g., MM/dd/yyyy |
| timeZone | Which time zone to display the date for? |
| var | If 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. |
| scope | When the var attribute is present, the scope attribute specifies the scope of the resulting variable. |
.