File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting wrong value after converting a string into date

 
aman thind
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my code:
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd");
dateFormat.setLenient(true);
Date convertedDate=null;
convertedDate = dateFormat.parse(2008-08-25);

Date and year are coming correct but month is always showing Jan

Little help here please
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you mean months and not minutes

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
 
aman thind
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Vanyavchich wrote:I think you mean months and not minutes

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");


Isn't that be default months??
OOps thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic