How about using Joda-Time. It's a far better date-time API to work with (And January means january here. It's not like Calendar, which uses 0-based index for months).
This code has language support.
I had used them in Android App.
String[] mons = new DateFormatSymbols().getShortMonths();//Jan,Feb,Mar,...
String[] months = new DateFormatSymbols().getMonths();//January,Februaty,March,...
I created a Kotlin extension based on responses in this topic and using the DateFormatSymbols answers you get a localized response.
fun Date.toCalendar(): Calendar {
val calendar = Calendar.getInstance()
calendar.time = this
return calendar
}
fun Date.getMonthName(): String {
val month = toCalendar()[Calendar.MONTH]
val dfs = DateFormatSymbols()
val months = dfs.months
return months[month]
}
Calender cal = Calendar.getInstance(Locale.ENGLISH)
String[] mons = new DateFormatSymbols(Locale.ENGLISH).getShortMonths();
int m = cal.get(Calendar.MONTH);
String mName = mons[m];