I'm having issues when converting a date to string in a different format. The date:
lastDownloadDate>>Wed Feb 27 16:20:23 IST 2013
lastChangeDate>>Wed Feb 27 15:11:00 IST 2013
I want to convert this format to another format: yyyy-mm-dd HH:mm:ss
.
When I try to convert it I'm getting different results using:
DateFormat outputFormat = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");
String lastDownloadTimeVal = outputFormat.format(lastDownloadDate);
System.out.println("lastDownloadTimeVal>>"+lastDownloadTimeVal);
String lastChangeTimeVal = outputFormat.format(lastChangeDate);
System.out.println("lastChangeTimeVal>>"+lastChangeTimeVal);
I'm getting the wrong result, the month is being replaced with minutes:
lastDownloadTimeVal>>2013-20-27 16:20:23
lastChangeTimeVal>>2013-11-27 15:11:00