public static void main(String[] args) {
DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
DateFormat format2= new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
Date date = null;
Date date2 = new Date();
String str = null;
// String转Date
str = "2007-1-18";
try {
date = format1.parse(str);
format2.format(date2);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println( format2.format(date2));
}