aspose file tools*
The moose likes Java in General and the fly likes Date Format Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Date Format Problem" Watch "Date Format Problem" New topic
Author

Date Format Problem

Pol Appan
Ranch Hand

Joined: Aug 26, 2004
Posts: 144
I have date which is in the format 2006-04-21 23:31:48.0

str_dt = 2006-04-21 23:31:48.0

When I used format_dt = inputFormat.parse(str_dt);

I am getting excpetion java.text.ParseException: Unparseable date: "2006-04-21 23:31:48.0"

How can I resolve this? I need to format my date and insert into oracle database with date and time.

Thanks in advance


Never take anything for granted because you never know when you will lose it
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

You should set the proper format first:



[My Blog]
All roads lead to JavaRanch
 
Don't get me started about those stupid light bulbs.
 
subject: Date Format Problem