| Author |
Converting "Mon Nov 24 00:00:00 EST 2008" pattern to "dd/MM/yyyy" pattern
|
kasthala kasturi
Greenhorn
Joined: Dec 20, 2006
Posts: 3
|
|
Hi All,
In my application, there is a column in a database view called "date of birth" whose datatype is "date". I am retrieving the date of birth field from the database view on to the JSP screen but somehow, the date format "Mon Nov 24 00:00:00 EST 2008" is being displayed on JSP screen.
Please someone let me know how to convert this pattern "Mon Nov 24 00:00:00 EST 2008" to "dd/MM/yyyy" (24/11/2008) pattern?
Thanks in advance.
Kind Regards,
Shyam Kasthala
|
 |
Rene Larsen
Ranch Hand
Joined: Oct 12, 2001
Posts: 1179
|
|
|
You should have a look at the SimpleDateFormat class - which can take a java.util.Date and transform it to a String date defined with a pattern.
|
Regards, Rene Larsen
Dropbox Invite
|
 |
Michael Angstadt
Ranch Hand
Joined: Jun 17, 2009
Posts: 272
|
|
You can also use the JSTL <fmt:formatDate> tag to format dates.
The "pattern" attribute takes a format string which shares the same rules as SimpleDateFormat.
|
SCJP 6 || SCWCD 5
|
 |
kasthala kasturi
Greenhorn
Joined: Dec 20, 2006
Posts: 3
|
|
Thanks for your replies.
I will implement your suggestions and get back to you.
Kind Regards,
Shyam Kasthala
|
 |
 |
|
|
subject: Converting "Mon Nov 24 00:00:00 EST 2008" pattern to "dd/MM/yyyy" pattern
|
|
|