package com.fuxi.test.date;
/**
* 将日期格式进行转换
*/
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateFormatTest {
public static void main(String[] args) {
SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat df = new SimpleDateFormat("yyyy年MM月dd日");
try {
Date d = df.parse("2009年11月17日");
System.out.println(df2.format(d));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}