Computer >> Computer tutorials >  >> Programming >> Programming

How to print a date using JSP Expression?


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