• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert String value to Date Object

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

How to convert a String "Wed Oct 15 00:00:00 GMT+05:30 2008" to Date [by using format or any other way ] ?. i tried using SimpleDateFormat but failed
 
Rob Spoor
Sheriff
Pie
Posts: 20659
64
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you haven't used the right pattern. Which one did you use?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the late reply

this is my code:



the Exception is : java.text.ParseException: Unparseable date: "Wed Oct 15 00:00:00 GMT+05:30 2008"

thanks
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh , sily mistake! [Problem Solved]

this is right pattern.



thanks Rob
 
Rob Spoor
Sheriff
Pie
Posts: 20659
64
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome. I know that sometimes you can find solutions yourself just by sharing the problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic