Popular Posts

Monday, June 1, 2009

JSP date example

<%@page contentType="text/html" import="java.util.*" %>

<!--

http://www.roseindia.net/jsp

-->

<html>
<body>
<p> </p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing
="0" width="460" bgcolor="#EEFFCA">

<tr>
<td width="100%"><font size="6" color
="#008000"> Date Example</font></td>

</tr>
<tr>
<td width="100%"><b> Current Date
and time is:  <font color="#FF0000">


<%= new java.util.Date() %>
</font></b></td>
</tr>
</table>
</center>
</div>
</body>
</html>

The heart of this example is Date() function of the java.util package which returns the current data and time.

In the JSP Declaratives

<%@page contentType="text/html" import="java.util.*" %>

we are importing the java.util package and following JSP Expression code

<%= new java.util.Date() %>

3 comments:

  1. I certainly agree to some points that you have discussed on this post. I appreciate that you have shared some reliable tips on this review.

    ReplyDelete
  2. I certainly agree to some points that you have discussed on this post. I appreciate that you have
    shared some reliable tips on this review.

    ReplyDelete
  3. Awesome work.Just wanted to drop a comment and say I am new to your blog and really like what I am reading.Thanks for the share

    ReplyDelete