List of usage examples for java.util Locale ITALY
Locale ITALY
To view the source code for java.util Locale ITALY.
Click Source Link
From source file:Main.java
public static void main(String[] args) { Locale locale = Locale.ITALY; System.out.println("Locale1:" + locale); // print the country of this locale System.out.println("Country:" + locale.getCountry()); }
From source file:Main.java
public static void main(String[] args) throws Exception { NumberFormat formatter = NumberFormat.getNumberInstance(Locale.ITALY); String number = formatter.format(123456789.12); System.out.println("Number in Italy: " + number); formatter = NumberFormat.getNumberInstance(Locale.JAPAN); number = formatter.format(123456789.12); System.out.println("Number in Japan: " + number); }
From source file:Main.java
public static void main(String args[]) { Locale currentLocale = Locale.getDefault(); Locale locales[] = { Locale.TAIWAN, Locale.KOREA, Locale.ITALY, Locale.CANADA, Locale.CANADA_FRENCH }; System.out.println("CURRENT LOCALE:"); describeLocale(currentLocale);/*from w w w. jav a 2 s. co m*/ System.out.println("OTHER LOCALES:"); for (int i = 0; i < locales.length; ++i) describeLocale(locales[i]); }
From source file:FormatDateLocale.java
public static void main(String[] args) { Locale[] locales = new Locale[] { Locale.JAPAN, Locale.CHINA, Locale.KOREA, Locale.TAIWAN, Locale.ITALY, Locale.FRANCE, Locale.GERMAN }; Date today = new Date(); for (Locale locale : locales) { System.out.println("Date format in " + locale.getDisplayName() + " = " + SimpleDateFormat.getDateInstance(SimpleDateFormat.LONG, locale).format(today).toUpperCase()); }/* w w w . j a va2 s . co m*/ }
From source file:Main.java
public static void main(String args[]) { SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT); System.out.println("The short date format is " + df.toPattern()); Locale loc = Locale.ITALY; df = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, loc); System.out.println("The short date format is " + df.toPattern()); }
From source file:Main.java
public static void main(String[] args) { NumberFormat formatter = new DecimalFormat(); Locale locale = Locale.getDefault(); System.out.println("Locale = " + locale); System.out.println(formatter.format(123.123)); locale = Locale.ITALY; Locale.setDefault(locale);//from ww w . j a v a 2 s .co m formatter = new DecimalFormat(); System.out.println("Locale = " + locale); System.out.println(formatter.format(123.123)); }
From source file:Main.java
public static void main(String args[]) { Formatter fmt = new Formatter(); Calendar cal = Calendar.getInstance(); fmt = new Formatter(); fmt.format("Default locale: %tc\n", cal); fmt.format(Locale.GERMAN, "For Locale.GERMAN: %tc\n", cal); fmt.format(Locale.ITALY, "For Locale.ITALY: %tc\n", cal); fmt.format(Locale.FRANCE, "For Locale.FRANCE: %tc\n", cal); System.out.println(fmt);//from ww w . j a v a2 s.c om }
From source file:Main.java
public static void main(String args[]) { int style = DateFormat.MEDIUM; // Also try with style = DateFormat.FULL and DateFormat.SHORT Date date = new Date(); DateFormat df;// w w w . j ava 2s . c om df = DateFormat.getDateInstance(style, Locale.UK); System.out.println("United Kingdom: " + df.format(date)); df = DateFormat.getDateInstance(style, Locale.US); System.out.println("USA: " + df.format(date)); df = DateFormat.getDateInstance(style, Locale.FRANCE); System.out.println("France: " + df.format(date)); df = DateFormat.getDateInstance(style, Locale.ITALY); System.out.println("Italy: " + df.format(date)); df = DateFormat.getDateInstance(style, Locale.JAPAN); System.out.println("Japan: " + df.format(date)); }
From source file:Main.java
public static String getStringTime() { Calendar c = Calendar.getInstance(Locale.ITALY); return c.get(Calendar.HOUR_OF_DAY) + ":" + c.get(Calendar.MINUTE) + ":" + c.get(Calendar.SECOND); }
From source file:org.hibernate.search.test.dsl.embedded.DslEmbeddedSearchTest.java
private static Calendar createCalendar() { return Calendar.getInstance(TimeZone.getTimeZone("Europe/Rome"), Locale.ITALY); }