标签:技术分享 system eth code family method new import col
1 package test; 2 3 import java.text.DateFormat; 4 import java.util.Date; 5 import java.util.Locale; 6 7 public class FormatDate { 8 9 public static void main(String[] args) { 10 // TODO Auto-generated method stub 11 Date date = new Date(); 12 DateFormat formater = DateFormat.getDateInstance(DateFormat.FULL, Locale.CHINA); 13 //中国日期 14 String string = formater.format(date); 15 System.out.println("中国日期:\t" + string); 16 //加拿大日期 17 formater = DateFormat.getDateInstance(DateFormat.FULL, Locale.CANADA); 18 System.out.println("加拿大日期: \t" + formater.format(date)); 19 //日本日期 20 formater = DateFormat.getDateInstance(DateFormat.FULL, Locale.JAPAN); 21 System.out.println("日本日期: \t" + formater.format(date)); 22 //法国日期 23 formater = DateFormat.getDateInstance(DateFormat.FULL, Locale.FRANCE); 24 System.out.println("法国日期: \t" + formater.format(date)); 25 //德国日期 26 formater = DateFormat.getDateInstance(DateFormat.FULL, Locale.GERMAN); 27 System.out.println("德国日期: \t" + formater.format(date)); 28 //意大利日期 29 formater = DateFormat.getDateInstance(DateFormat.FULL, Locale.ITALY); 30 System.out.println("意大利日期: \t" + formater.format(date)); 31 } 32 33 }
标签:技术分享 system eth code family method new import col
原文地址:https://www.cnblogs.com/luckyliulin/p/8982464.html