Instead of using an instance of the Calendar class, you use java.text.DateFormatSymbols to retrieve information such as month names, weekday names for a specific locale. Here is an example to get the names of working days in Germany.
String[] weekdays = new DateFormatSymbols(Locale.GERMANY).getWeekdays(); for (int i = 0; i < weekdays.length; i++) { System.out.println("weekday = " + weekdays[i]); }
user2264310
source share