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

John Zukowski

Pass the locale to the DateFormatSymbols constructor and ask for the list of month symbols:

Locale locale = new Locale("es", "ES");
DateFormatSymbols symbols = 
  new DateFormatSymbols(locale);
String monthNames[] = symbols.getMonths();
For English / the default locale, don't pass anything to the constructor.
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact