Tuesday 15 January 2019

How to use getAvailableLocales() method of java.text.DateFormat class | Datetimeformatter in java


Click here to watch on Youtube: 
https://www.youtube.com/watch?v=PyLAhXk35GE&list=UUhwKlOVR041tngjerWxVccw

DateFormatDemo.java

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

public class DateFormatDemo
{
    public static void main(String[] args)
    {
        /*
         * Returns:
         *
         * An array of locales for which localized DateFormat
         * instances are available.
         */

        Locale[] localeArray = DateFormat.getAvailableLocales();
     
        for (Locale locale : localeArray)
        {
            System.out.println(locale.getDisplayName());
        }

    }

}

Output:


Arabic (United Arab Emirates)
Arabic (Jordan)
Arabic (Syria)
Croatian (Croatia)
French (Belgium)
Spanish (Panama)
Maltese (Malta)
Spanish (Venezuela)
Bulgarian
Chinese (Taiwan)
Italian
Korean
Ukrainian
Latvian
Danish (Denmark)
Spanish (Puerto Rico)
Vietnamese (Vietnam)
English (United States)
Serbian (Montenegro)
Swedish (Sweden)
Spanish (Bolivia)
English (Singapore)
Arabic (Bahrain)
Portuguese
Arabic (Saudi Arabia)
Slovak
Arabic (Yemen)
Hindi (India)
Irish
English (Malta)
Finnish (Finland)
Estonian
Swedish
Czech
Serbian (Latin,Bosnia and Herzegovina)
Greek
Ukrainian (Ukraine)
Hungarian
French (Switzerland)
Indonesian
Spanish (Argentina)
Arabic (Egypt)
Japanese (Japan,JP)
Spanish (El Salvador)
Portuguese (Brazil)
Belarusian
Icelandic (Iceland)
Czech (Czech Republic)
Spanish
Polish (Poland)
Turkish
Catalan (Spain)
Serbian (Serbia and Montenegro)
Malay (Malaysia)
Croatian
Lithuanian
Spanish (Spain)
Spanish (Colombia)
Bulgarian (Bulgaria)
Albanian
French
Japanese
Serbian (Bosnia and Herzegovina)
Icelandic
Spanish (Paraguay)
German
Spanish (Ecuador)
Spanish (United States)
Arabic (Sudan)
English
Romanian (Romania)
English (Philippines)
Catalan
Arabic (Tunisia)
Serbian (Latin,Montenegro)
Spanish (Guatemala)
Slovenian
Korean (South Korea)
Greek (Cyprus)
Spanish (Mexico)
Russian (Russia)
Spanish (Honduras)
Chinese (Hong Kong)
Norwegian (Norway,Nynorsk)
Hungarian (Hungary)
Thai (Thailand)
Arabic (Iraq)
Spanish (Chile)
Finnish
Arabic (Morocco)
Irish (Ireland)
Macedonian
Turkish (Turkey)
Estonian (Estonia)
Arabic (Qatar)
Serbian (Latin)
Portuguese (Portugal)
French (Luxembourg)
Arabic (Oman)
Thai
Albanian (Albania)
Spanish (Dominican Republic)
Spanish (Cuba)
Arabic
Russian
English (New Zealand)
Serbian (Serbia)
German (Switzerland)
Spanish (Uruguay)
Malay
Greek (Greece)
Hebrew (Israel)
English (South Africa)
Thai (Thailand,TH)
Hindi
French (France)
German (Austria)
Dutch
Norwegian (Norway)
English (Australia)
Vietnamese
Dutch (Netherlands)
French (Canada)
Latvian (Latvia)
German (Luxembourg)
Spanish (Costa Rica)
Arabic (Kuwait)
Serbian
Arabic (Libya)
Maltese
Italian (Switzerland)
Danish
German (Germany)
Arabic (Algeria)
Slovak (Slovakia)
Lithuanian (Lithuania)
Italian (Italy)
English (Ireland)
Chinese (Singapore)
Romanian
English (Canada)
Dutch (Belgium)
Norwegian
Polish
Chinese (China)
Japanese (Japan)
German (Greece)
Serbian (Latin,Serbia)
Hebrew
English (India)
Arabic (Lebanon)
Spanish (Nicaragua)
Chinese
Macedonian (Macedonia)
Belarusian (Belarus)
Slovenian (Slovenia)
Spanish (Peru)
Indonesian (Indonesia)
English (United Kingdom)

Click the below link to download the code:
https://sites.google.com/site/javaspringram2019/java_spring_2019/DateFormatDemo_getAvailableLocales.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java_Spring_2019/tree/master/Java_2019/DateFormatDemo_getAvailableLocales

Bitbucket Link:
https://bitbucket.org/ramram43210/java_spring_2019/src/80d90bcf5505788c0f100e330fb6b354d3132ddb/Java_2019/DateFormatDemo_getAvailableLocales/?at=master

See also:
  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Spring Tutorial
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • Cooking Tutorial
  • No comments:

    Post a Comment