• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Converting "Mon Nov 24 00:00:00 EST 2008" pattern to "dd/MM/yyyy" pattern

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
kasthala kasturi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your replies.

I will implement your suggestions and get back to you.

Kind Regards,
Shyam Kasthala
reply
    Bookmark Topic Watch Topic
  • New Topic