Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date Format Problem

 
Pol Appan
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should set the proper format first:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic