Find current date and time using JSP - NESTED CODE || TECH FLOAT

Breaking

Post Top Ad

Post Top Ad

Saturday, 17 November 2012

Find current date and time using JSP

Now we will do a simple program. we will find the current date and time using JSP

The code is like

<%-- 
    Document   : Date
    Created on : 21 Sep, 2012, 6:02:24 PM
    Author     : Nested Code
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <%@ page import="java.util.*"  %>
    </head>
    <body>
        <h2>The date is::</h2>
        <% Date date=new Date();
        out.println(date); %>
    </body>
</html>

It is very simple. Try this. Out put will be like


No comments:

Post a Comment

Post Bottom Ad