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

Mumbai University > information technology > sem 4> Web Programming

Marks: 5M

Year : Dec16

0  upvotes
0

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.*" %>
<html>
<head>
<title>Display Current Date & Time</title>
</head>
<body>
<center>
<h1>Display Current Date & Time</h1>
</center>
<%
   Date date = new Date();
   out.print( "<h2 align=\"center\">" +date.toString()+"</h2>");
%>
</body>
</html>
0  upvotes
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.

Search

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