Write a program to find the current date and time using JSP..

Mumbai University > information technology > sem 4> Web Programming

Marks: 5M

Year : Dec16


Getting Current Date & Time

This is very easy to get current date and time in JSP program. You can use a simple Date object with toString() method to print current date and time as follows:

<%@ page import="java.io.*,java.util.*, javax.servlet.*" %>
<title>Display Current Date & Time</title>
<h1>Display Current Date & Time</h1>
   Date date = new Date();
   out.print( "<h2 align=\"center\">" +date.toString()+"</h2>");
Please log in to add an answer.

Next up

Read More Questions

If you are looking for answer to specific questions, you can search them here. We'll find the best answer for you.


Study Full Subject

If you are looking for good study material, you can checkout our subjects. Hundreds of important topics are covered in them.

Know More