aspose file tools
The moose likes Java in General and the fly likes java.util.Date Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "java.util.Date" Watch "java.util.Date" New topic
Author

java.util.Date

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 602
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
Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 279
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: java.util.Date
 
Similar Threads
converting string yyyy/MM/dd to java.util.Date
Parsing a date and retaining the format
Date Formatting
Using java.util.Date for comparison
convert the "Mon Oct 11 00:00:00 IST 2012" into a Date object