This tag in JSTL is used to read(parsing) the Date as per required format Pattern. Attributes That are mandatory to use are avail in this tag like value or pattern. The main attribute Is pattern That will instruct that in which format the date will be displayed.

 

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

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

<html>

     <head>

           <title>&lt;fmt:parseDate&gt; Tag In JSTL</title>

     </head

            <body>

                <b><center><h3>Displaying of Date Parsing In JSTL</h3>

                        <c:set var="now" value="2014-07-29" />

                        <fmt:parseDate value="${now}" var="p_Date"  pattern="yyyy-mm-dd" />

                <b><center><p>Parsed Date: <c:out value="${p_Date}" /></p></center></b>

            </body>

</html>

       JSTL Tag <fmt:parseDate>

This program will use To explain the tag <fmt: parsedDate>. The tag library imported first as required as per condition then after declaring some mandatory variable with their respective attributes. The Body of program with HTML and JSTL tags the output is been displayed on the web browser. In the last we close all the tags.



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Search Content