How can I convert an Integer to localized month name in Java?
import java.text.DateFormatSymbols;
public String getMonth(int month) {
return new DateFormatSymbols().getMonths()[month-1];
}
You need to use LLLL for stand-alone month names. this is documented in the SimpleDateFormat
documentation, such as:
SimpleDateFormat dateFormat = new SimpleDateFormat( "LLLL", Locale.getDefault() );
dateFormat.format( date );