/**
* y : 年
* M : 月
* d : 日
* H : 时
* m : 分
* s : 秒
* 2020年5月12日 23:11 20
*/SimpleDateFormat s =newSimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");//format:将SimpleDateFormat对象转换成字符串yyyy年MM月dd日 HH:mm:ssString text = s.format(newDate());System.out.println(text);