File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date Format Problem
 
Similar Threads
error in formatting miliseconds for date objects
sql date convert
how to convert string into string array
ConcurrentLinkedQueue
Date Time conversion