Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting String to java.util.Date

843833Jun 18 2001 — edited Jun 18 2001
Hello,
I need to convert String to java.util.Date.

I try to using parse method,but always getting a Parsing Exception.Here the code is

SimpleDateFormat dateFormat=new SimpleDateFormat("DD-MON-YYYY");
try{
java.util.Date presDate=dateFormat.parse("01-JAN-2000");
}catch(ParseException pex){System.out.println("Parsing Exception");}

Please help me to get rid of this exception

regards
Patil DB
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 16 2001
Added on Jun 18 2001
2 comments
219 views