dcsimg

How do I get a list of weekday names for a locale?

John Zukowski

Pass the locale to the DateFormatSymbols constructor and ask for the list of weekday names:


Locale locale = new Locale("es", "ES");
DateFormatSymbols symbols = 
  new DateFormatSymbols(locale);
String dayNames[] = symbols.getWeekdays();
For English / the default locale, don't pass anything to the constructor.