List of usage examples for java.util Locale ENGLISH
Locale ENGLISH
To view the source code for java.util Locale ENGLISH.
Click Source Link
From source file:Main.java
public static void main(String[] args) { Locale locale = Locale.ENGLISH; 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) { GregorianCalendar cal = new GregorianCalendar(Locale.ENGLISH); System.out.println(cal.getTime()); }
From source file:MainClass.java
public static void main(String[] args) { NumberFormat percentFormat = NumberFormat.getPercentInstance(Locale.ENGLISH); for (double d = 0.0; d <= 1.0; d += 0.005) { System.out.println(percentFormat.format(d)); }/*from w w w. ja v a 2 s .c o m*/ }
From source file:Main.java
public static void main(String[] args) throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("dd-MMMM-yyyy", Locale.ENGLISH); System.out.println(sdf.parse("29-July-2012")); }
From source file:Main.java
public static void main(String[] argv) { System.out.println(convertDateToStringRfc822(Calendar.getInstance(), Locale.ENGLISH)); }
From source file:Main.java
public static void main(String[] args) { String s = "java2s.com 1 + 1 = 2.0 true "; Scanner scanner = new Scanner(s); System.out.println(scanner.nextLine()); // change the locale of the scanner scanner.useLocale(Locale.ENGLISH); // display the new locale System.out.println(scanner.locale()); scanner.close();//ww w . j a v a2 s . c o m }
From source file:Main.java
public static void main(String[] args) throws Exception { String input = "Thu Jun 06 2015 00:00:00 GMT+0530 (India Standard Time)"; DateFormat inputFormat = new SimpleDateFormat("E MMM dd yyyy HH:mm:ss 'GMT'z", Locale.ENGLISH); Date date = inputFormat.parse(input); DateFormat outputFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss", Locale.ENGLISH); outputFormat.setTimeZone(TimeZone.getTimeZone("UTC")); String output = outputFormat.format(date); System.out.println(output);//from w w w .j a v a2 s .co m }
From source file:org.springforpro.chptr5.context.MessageSourceDemo.java
public static void main(String[] args) { GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); ctx.load("classpath:appContext/messageSource.xml"); ctx.refresh();/* w w w .j a v a2 s .co m*/ Locale english = Locale.ENGLISH; Locale russian = new Locale("ru", "RU"); System.out.println("English msg: " + ctx.getMessage("msg", null, english)); System.out.println("Russian msg: " + ctx.getMessage("msg", null, russian)); System.out .println("English nameMsg" + ctx.getMessage("nameMsg", new Object[] { "Clarence", "Ho" }, english)); // ResourceBundleMessageSource source = new ResourceBundleMessageSource(); // StaticMessageSource source = new StaticMessageSource(); // source.setBasename("appContext/labels"); // System.out.println(source.getMessage("msg", null, russian) ); // System.out.println(source.getMessage("msg", null, english) ); // Object[] os = new Object[] {"One", "two"}; // System.out.println(source.getMessage("nameMsg", new Object[] {"wut", "in my butt"}, english)); }
From source file:com.home.ln_spring.ch5.context.MessageSourceDemo.java
public static void main(String[] args) { GenericXmlApplicationContext context = new GenericXmlApplicationContext(); context.load("classpath:appContext/messageSource.xml"); context.refresh();// w w w.j ava 2 s . c o m Locale english = Locale.ENGLISH; Locale czech = new Locale("cs", "CZ"); System.out.println(context.getMessage("msg", null, english)); System.out.println(context.getMessage("msg", null, czech)); System.out.println( context.getMessage("nameMsg", new Object[] { "Dynisyuk", "Vitaliy", "Vladimirovich" }, english)); }
From source file:be.dnsbelgium.rdap.client.ManGenerator.java
public static void main(String[] args) { Options options = new RDAPOptions(Locale.ENGLISH); Iterator<Option> it = options.getOptions().iterator(); StringBuilder sb = new StringBuilder(); while (it.hasNext()) { Option option = it.next(); sb.append(String.format(".IP \"%s\"\n%s\n", getOptionString(option), option.getDescription() == null ? "" : option.getDescription())); }//from w w w . j a v a2 s .c o m System.out.println(sb.toString()); }