The result in the java.util.Date object is something which looks like this
Sun Dec 30 00:00:00 CST 2012
As I'd expect it to be 2013-06 with a 6 in the variable i.
Any help would be greatly appreciated.
posted 3 years ago
1.) Year is represented by a small y not capital Y. The the docs for the SimpleDateFormat class for examples.
2.) If you are getting the date as a String then why do you need to parse it to a util.Date if you want to display the Date as String? To display the date as a String you would have to use the format method.
3.) You are doing the parse inside the while loop, right?