Date a = new Date();
System.out.println(a);//输出结果:Sun Mar 10 18:37:32 CST 2013
String b = DateFormat.getInstance().format(a);
System.out.println(b);//13-3-10 下午6:43
String c = DateFormat.getTimeInstance().format(a);
System.out.println(c);//18:43:19
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
System.out.println(sdf.format(a));//2013-03-10 06:43:19