package i18n;
import java.text.DateFormat;
import java.text.Format;
import java.util.Date;
import java.util.Locale;
public class FormaterTest {
public static void testDateFormat(){
//output=2009年12月10日 星期四 //Format format =DateFormat.getDateInstance(DateFormat.FULL); Locale currlocale = Locale.getDefault();
Locale enlocal = Locale.ENGLISH;
//返回英国 Format format =DateFormat.getDateInstance(DateFormat.FULL);
Format format2 =DateFormat.getDateInstance();
Format format3 =DateFormat.getDateInstance(DateFormat.MEDIUM, enlocal);
Format format4 =DateFormat.getDateTimeInstance();
Format format5 =DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL);
String output =format.format(
new Date());
String output2 =format2.format(
new Date());
String output3 =format3.format(
new Date());
String output4 = format4.format(
new Date());
String output5 = format4.format(
new Date());
System.out.println(output);
System.out.println(output2);
System.out.println(output3);
System.out.println(output4);
System.out.println(output5);
}
public static void main(String[] args) {
testDateFormat();
}
}