List of usage examples for java.util Locale KOREA
Locale KOREA
To view the source code for java.util Locale KOREA.
Click Source Link
From source file:Main.java
public static void main(String[] args) { Locale locale = Locale.KOREA; 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[]) { 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 .ja v a2 s. c o 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()); }/*from w w w . ja va2s . c o m*/ }
From source file:MainClass.java
public static void main(String args[]) { Date date = new Date(); DateFormat df;//from w ww. jav a2 s. c o m df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.JAPAN); System.out.println("Japan: " + df.format(date)); df = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.KOREA); System.out.println("Korea: " + df.format(date)); df = DateFormat.getDateInstance(DateFormat.LONG, Locale.UK); System.out.println("United Kingdom: " + df.format(date)); df = DateFormat.getDateInstance(DateFormat.FULL, Locale.US); System.out.println("United States: " + df.format(date)); }
From source file:Main.java
public static boolean isLocaleKorea() { return Locale.getDefault().getCountry().equals(Locale.KOREA.getCountry()); }
From source file:Main.java
public static String getDay(Date date) { SimpleDateFormat df = new SimpleDateFormat("dd", Locale.KOREA); String strDay = df.format(date); return strDay; }
From source file:Main.java
public static String getMonth(Date date) { SimpleDateFormat df = new SimpleDateFormat("MM", Locale.KOREA); String strMonth = df.format(date); return strMonth; }
From source file:Main.java
public static String getYear(Date date) { SimpleDateFormat df = new SimpleDateFormat("yyyy", Locale.KOREA); String strYear = df.format(date); return strYear; }
From source file:Main.java
public static int getIntDateValue() { dataFormat = new SimpleDateFormat("MMdd", Locale.KOREA); Date date = new Date(); int today = Integer.parseInt(dataFormat.format(date)); return today; }
From source file:Main.java
public static Calendar StringToCal(String date) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm", Locale.KOREA); Date scheduleTime = null;/*from ww w .ja v a2 s . co m*/ try { scheduleTime = sdf.parse(date); } catch (ParseException e) { e.printStackTrace(); } Calendar cal = Calendar.getInstance(); cal.setTime(scheduleTime); return cal; }