<div dir="ltr" style="text-align: justify;" trbidi="on">
<div dir="ltr" style="text-align: justify;" trbidi="on">
<div dir="ltr" style="text-align: justify;" trbidi="on"><i><b>The <;fmt:formatDate>; tag</b></i> is used to format dates in a variety of ways. This tag is used to format date and time according to the user supplied style and format. </p>
<table border="0" style="-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; width: 67%px; word-spacing: 0px;">
<tbody>
<tr>
<td bgcolor="#FFECFF" width="100%"><b>Attributes of the tag ;</b><b><;fmt:formatDate>;</b><b><br />
</b></p>
<table bgcolor="#FFFFCC" border="1" style="height: 198px; width: 100%px;">
<tbody>
<tr>
<td height="38" width="8%"><b>value</b></td>
<td height="38" width="92%"> ;supplied date and time to be formatted.</td>
</tr>
<tr>
<td height="19" width="8%"><b>type</b></td>
<td height="19" width="92%"> ;specifies that time or date or both date and time to be formatted of given date/time. ;</td>
</tr>
<tr>
<td height="19" width="8%"><b>dateStyle</b></td>
<td height="19" width="92%"> ;predefined styles to represent date. For example- default, short, long, full etc</td>
</tr>
<tr>
<td height="19" width="8%"><b>timeStyle</b></td>
<td height="19" width="92%"> ; ;predefined styles to represent time. For example- default, short, long, full etc</td>
</tr>
<tr>
<td height="17" width="8%"><b>pattern</b></td>
<td height="17" width="92%"> ;provided by user in what pattern user want to format. For example: dd-mm-yyyy</td>
</tr>
<tr>
<td height="19" width="8%"><b>timeZone</b></td>
<td height="19" width="92%"> ;in which time zone user want to represent date/time.</td>
</tr>
<tr>
<td height="19" width="8%"><b>var</b></td>
<td height="19" width="92%"> ;var is a variable that is used to store created data source.</td>
</tr>
<tr>
<td height="19" width="8%"><b>Scope</b></td>
<td height="19" width="92%"> ;Define the scope for declared variable like page or request or session or application.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><b><br />
</b> <b>Example:</b></p>
<pre class="highlight" name="code"><;%@ 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>;JSTL fmt:dateNumber Tag<;/title>;
<;/head>;
<;body>;
<;h3>;Number Format:<;/h3>;
<;c:set var="date" value="<;%=new java.util.Date()%>;" />;

<;table bgcolor="#D8D8D8" border="1" width="70%">;
<;tr>;
<;td width="100%" colspan="2" bgcolor="#1C1C1C">;
<;p align="center">;<;b>; <;font color="#D8D8D8" size="4">;Formatting: 
<;fmt:formatDate value="${date}" type="both" timeStyle="long" 
dateStyle="long" />; 
<;/font>;
<;/b>;<;/p>;
<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : type="date"<;/td>;
<;td width="49%">;<;fmt:formatDate type="date" value="${date}" />;<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : type="time"<;/td>;
<;td width="49%">;<;fmt:formatDate type="time" value="${date}" />;<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : type="both"<;/td>;
<;td width="49%">;<;fmt:formatDate type="both" value="${date}" />;<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : type="both" dateStyle="default"
timeStyle="default"<;/td>;
<;td width="49%">;<;fmt:formatDate type="both" dateStyle="default"
timeStyle="default" value="${date}" />;<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : type="short" dateStyle="default"
timeStyle="short"<;/td>;
<;td width="49%">;<;fmt:formatDate type="both" dateStyle="short"
timeStyle="short" value="${date}" />;<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : type="both" dateStyle="medium"
timeStyle="medium"<;/td>;
<;td width="49%">;<;fmt:formatDate type="both" dateStyle="medium"
timeStyle="medium" value="${date}" />;<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : type="both" dateStyle="long"
timeStyle="long"<;/td>;
<;td width="49%">;<;fmt:formatDate type="both" dateStyle="long"
timeStyle="long" value="${date}" />;<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : type="both" dateStyle="full"
timeStyle="full"<;/td>;
<;td width="49%">;<;fmt:formatDate type="both" dateStyle="full"
timeStyle="full" value="${date}" />;<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : pattern="yyyy-MM-dd"<;/td>;
<;td width="49%">;<;fmt:formatDate pattern="yyyy-MM-dd" value="${date}" />;
<;/td>;
<;/tr>;
<;tr>;
<;td width="51%">;Attribute : pattern="yyyy-MM-dd hh:mm:ss"<;/td>;
<;td width="49%">;<;fmt:formatDate pattern="yyyy-MM-dd hh:mm:ss"
value="${date}" />;<;/td>;
<;/tr>;
<;/table>;
<;/body>;
<;/html>;
</pre>
<p><b><br />
</b> <b>This would produce following result:</b></p>
<div align="center" id="ads-id"></div>
<div class="separator" style="clear: both; text-align: center;"><img border="0" src="http://50.87.249.200/~dineshon/wp-content/uploads/2013/10/222222.png"/></div>
<p>
</div>
<p><i><b><;fmt:parseDate>; </b></i><b>Tag</b>&#8211;<br />
The <;fmt:parseDate>; tag is used to parse dates.</p>
<p> <b>Example-</b></p>
<pre class="highlight" name="code"><;%@ 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>;JSTL fmt:parseDate Tag<;/title>;
<;/head>;
<;body>;
<;h3>;Date Parsing:<;/h3>;
<;c:set var="now" value="20-10-2013" />;

<;fmt:parseDate value="${now}" var="parsedEmpDate" 
 pattern="dd-MM-yyyy" />;
<;p>;Parsed Date: <;c:out value="${parsedEmpDate}" />;<;/p>;

<;/body>;
<;/html>;
</pre>
<p><b>This would produce following result:</b></p>
<div class="separator" style="clear: both; text-align: center;"><img border="0" src="http://50.87.249.200/~dineshon/wp-content/uploads/2013/10/333-7.png"/></div>
<p>
</div>
<div style="background-color: pink; border-width: thin; text-align: center;"><b><;<;<a href="https://dineshonjava.com/2013/10/jstl-parse-number-example.html">Previous</a> <;<; ; ; || <a href="https://dineshonjava.com/2013/10/jsp-standard-tag-library-jstl-tutorial.html">Index </a>||  ; >;>;<a href="https://dineshonjava.com/2013/10/jstl-bundle-tag.html">Next</a> >;>;</b></div>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/jstl-parse-number-example/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/jstl-bundle-tag/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '305'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…