FileDocCategorySizeDatePackage
UseLocales.javaAPI DocExample855Fri Mar 30 10:21:50 BST 2001None

UseLocales

public class UseLocales extends Object
Use some locales choices or -Duser.lang= or -Duser.region=.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)


		Locale frLocale = Locale.FRANCE;	// predefined
		Locale ukLocale = new Locale("en", "UK");	// English, UK version

		DateFormat defaultDateFormatter = DateFormat.getDateInstance(
			DateFormat.MEDIUM);
		DateFormat frDateFormatter = DateFormat.getDateInstance(
			DateFormat.MEDIUM, frLocale);
		DateFormat ukDateFormatter = DateFormat.getDateInstance(
			DateFormat.MEDIUM, ukLocale);

		Date now = new Date();
		System.out.println("Default: " + ' " +
			defaultDateFormatter.format(now));
		System.out.println(frLocale.getDisplayName() + ' " +
			frDateFormatter.format(now));
		System.out.println(ukLocale.getDisplayName() + ' " +
			ukDateFormatter.format(now));