Get all locales

static Locale[] getAvailableLocales()
Returns an array of all locales for which the get*Instance methods of this class can return localized instances.

import java.text.DateFormat;
import java.util.Locale;

public class Main{
  public static void main(String args[]) {
    Locale[]  locales = DateFormat.getDateInstance().getAvailableLocales();
    for(Locale l: locales){
      System.out.println(l.getDisplayCountry());
    }
   }
}

The output:


Japan
Peru

Japan
Panama
Bosnia and Herzegovina
...
...
Oman

Thailand


Sweden
Denmark
Honduras
Home 
  Java Book 
    Essential Classes  

DataFormat:
  1. DataFormat class
  2. Create new DateFormat instance
  3. Constants from DateFormat
  4. Format a date
  5. Get all locales
  6. Parse string to get Date