date.toLocaleString()的替换

Date date = new Date();
System.out.println("前:" + date.toLocaleString());
SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getDateTimeInstance(); 
System.out.println("后:" + sdf.format(date));

代码在线运行:https://tool.lu/coderunner/

原文地址:https://www.cnblogs.com/xiaostudy/p/11229811.html