how to print current date in JSP. I am using <%= new java.util.Date() %>, but I want to print date in the format like "October 01, 2008"

Hi I want to print date in the JSP page using default java method. I am using <%= new java.util.Date() %>. but the format in which it is printing date includes current date and time with GMT time zone. But I want to print in a format like "October 01, 2008 ".  Can you please help me what code i need to write for this in JSP.
yashjimmyAsked:
Who is Participating?
 
Ajay-SinghConnect With a Mentor Commented:
You can use this

<%= new java.text.SimpleDateFormat("MMMM dd, yyyy").format(new java.util.Date()) %>
0
 
yashjimmyAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.