java把字符串转换成日期格式

public static void main(String[] args) throws Exception{

Date date = new SimpleDateFormat("yyyy-MM-dd").parse("2005-06-09"); 
String now = new SimpleDateFormat("yyyy年MM月dd日").format(date);

System.out.println(now);

}

参考:

https://zhidao.baidu.com/question/154582977.html

猜你喜欢

转载自blog.csdn.net/l_degege/article/details/90412428