This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

convert the String value into java.util.Date

 
kan ashok
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i convert the String value into java.util.Date ?
I tried thru the following way :
String hai = "20/03/2004"; // mm/dd/yyyy
Date cdate = new SimpleDateFormat("mm/dd/yyyy").parse(hai);
It gives wrong Month.
 
Carlos Failde
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the API:
A month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth; thus 11 is December
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try look at your code!!

Witch month has the number '20'?
And the pattern for a month is MM. SimpleDateFormat
Ren´┐Ż
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic