class Solution {
public String month2int(String month) {
switch (month) {
case "Jan": return "01";
case "Feb": return "02";
case "Mar": return "03";
case "Apr": return "04";
case "May": return "05";
case "Jun": return "06";
case "Jul": return "07";
case "Aug": return "08";
case "Sep": return "09";
case "Oct": return "10";
case "Nov": return "11";
case "Dec": return "12";
}
return "";
}
public String reformatDate(String date) {
String year = date.substring(date.length()-4, date.length());
String month = month2int(date.substring(date.length()-8, date.length()-5));
String day = Character.isDigit(date.charAt(1)) ? date.substring(0, 2) : "0"+String.valueOf(date.charAt(0));
return year + "-" + month + "-" + day;
}
}