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
Updated on: 2019-07-30T22:30:25+05:30

386 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements