<%@page contentType="text/html" import="java.util.*" %>
| Date Example |
| Current Date and time is: <%= new java.util.Date() %> |
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() %>
prints the current date on the page.