Calculate previous 12 months from given month - SimpleDateFormat
问题 I am trying to get previous 12 month into an arraylist, from the given month(taken from DB). List<String> allDates = new ArrayList<String>(); sqlQuery="select max(date) from Table_Name"; maxDate="Jan-2016"; (Result from Query); To get previous 12 months from maxDate,where i use SimpleDateFormat. I want to calculate the previous 12 months from Given Month (maxDate), not from current month, i tried the following code. // Parsing maxDate to an integer (say Jan-2016 = 0, Feb-2016= 1) Date date =