I need to parse a date from this format: WeekDay Month DD HH:MM:SS GFT YYYY to this format: YYY/MM/DD, and this is what I tried to do:
SimpleDateFormat format = new SimpleDateFormat("YYYY/MM/DD");
String conclusionDate = format.format(filter.getConclusionDate());
But there is something wrong going on. For example, when I try to format this date: "Thu Sep 01 00:00:00 GFT 2016", what I get is "2016/09/245" instead of "2016/09/01"
The weirdest is that it seems to be happening only with months different than JANUARY. When I try another random example like "Sat Jan 01 00:00:00 GFT 2000" I get exactly what I want: " 2000/01/01 ". It still formats correctly if I vary the day field
But when I change it to be another month, like february (" Tue Feb 01 00:00:00 GFT 2000 "), I get it wrong: " 2000/02/32 "
Why is it?
OBS: Before you ask: Yes, I have checked and the date that is returned in getConclusionDate() is exactly in the expected format WeekDay Month DD HH:MM:SS GFT YYYY .