• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.util.Date

 
Ranch Hand
Posts: 647
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am getting the date in below format

Mon Jul 23 00:00:00 EDT 2007
But I do not want to display in this format. But to display it something like 07/23/2007
I am using the simpleDateFormat class to format the date. But I am getting the parse exception that it can not parse the above date.

Any pointers.

Thanks,
Trupti
 
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at the SimpleDateFormat Javadoc. All the pattern letters required to correctly parse a date in your format are described there.

If you are still unable to parse your date string correctly, start by parsing an easier string, e.g. Jul 23 2007, and keep building until you are able to parse the desired string value.
 
reply
    Bookmark Topic Watch Topic
  • New Topic