Converter data em string usando formato simpledate
Estou tendo problemas ao converter uma data para string em um formato diferente. A data:
lastDownloadDate>>Wed Feb 27 16:20:23 IST 2013
lastChangeDate>>Wed Feb 27 15:11:00 IST 2013
Eu quero converter este formato para outro formato:yyyy-mm-dd HH:mm:ss
.
Quando tento convertê-lo, estou obtendo resultados diferentes usando:
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);
Estou recebendo o resultado errado, o mês está sendo substituído por minutos:
lastDownloadTimeVal>>2013-20-27 16:20:23
lastChangeTimeVal>>2013-11-27 15:11:00