package class1;
import java.text.DateFormat;
import java.util.Date;
public class DateDemo03 {
public static void main(String[] args) {
DateFormat df1 = null ;
DateFormat df2 = null;
df1 = DateFormat.getDateInstance();
//df1 = DateFormat.getDateInstance(DateFormat.YEAR_FIELD,new Locale("zh","CN"));
df2 = DateFormat.getDateTimeInstance() ;
//df2 = DateFormat.getDateTimeInstance(DateFormat.YEAR_FIELE,DateFormat.ERA_FIELD,new Locale("zh","CN"));
System.out.println("DATE:" + df1.format(new Date()));
System.out.println("DATETIME:" + df2.format(new Date()));
}
}
import java.text.DateFormat;
import java.util.Date;
public class DateDemo03 {
public static void main(String[] args) {
DateFormat df1 = null ;
DateFormat df2 = null;
df1 = DateFormat.getDateInstance();
//df1 = DateFormat.getDateInstance(DateFormat.YEAR_FIELD,new Locale("zh","CN"));
df2 = DateFormat.getDateTimeInstance() ;
//df2 = DateFormat.getDateTimeInstance(DateFormat.YEAR_FIELE,DateFormat.ERA_FIELD,new Locale("zh","CN"));
System.out.println("DATE:" + df1.format(new Date()));
System.out.println("DATETIME:" + df2.format(new Date()));
}
}