How to print a date using JSP Expression?

JSPJava 8Object Oriented ProgrammingProgramming

Following example shows a JSP Expression printing date on the browser −

<html>
   <head>
      <title>A Comment Test</title>
   </head>
   <body>
      <p>Today's date: <%= (new java.util.Date()).toLocaleString()%></p>
   </body>
</html>

The above code will generate the following result −

Today's date: 11-Sep-2010 21:24:25
raja
Published on 20-Mar-2019 06:02:09
Advertisements