How do I format a date in a JSP page?
Date: 2010-09-16. Category: taglib / jstl examples. Hits: 17K time(s).
This example show how to format date in JSP using format tag library.
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
</head>
<body>
<jsp:useBean id="date" class="java.util.Date"/>
Today is: <fmt:formatDate value="${date}" type="date" pattern="dd-MMM-yyyy"/>
</body>
</html>
Learn more Java examples on taglib / jstl
|
|