source file name: DateJsp.jsp


<%@page import="java.util.Date"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<html>

    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <title>Date JSP Program</title>

    </head>

    <body>

    <%!    Date d=new Date(); %>

     <%     out.println("<h1>Today's Date and Time is! </h1>"+d ); %>

     

    </body>

</html>

output: