6 answers
DateTime d = datetime.now();Integer count = 1;Integer dtMonth = 0;while (count < 13) { String monthName = d.format('MMMMM'); monthName = monthName.substring(0,3); If(monthName == 'Compare your picklist value'){ dtMonth = d.month(); System.debug(dtMonth); break; } else{ d = d.addMonths(1); count++; }}