aspose file tools*
The moose likes Beginning Java and the fly likes getting wrong value after converting a string into date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "getting wrong value after converting a string into date" Watch "getting wrong value after converting a string into date" New topic
Author

getting wrong value after converting a string into date

aman thind
Ranch Hand

Joined: Jun 29, 2007
Posts: 71
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


Aman Thind
SCJP,SCWCD
JAVA utte mar JAVA,mit JAVA
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
I think you mean months and not minutes

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


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
aman thind
Ranch Hand

Joined: Jun 29, 2007
Posts: 71
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
 
subject: getting wrong value after converting a string into date