//1.获取计算机的当前系统时间并打印出来,要求将时间格式转换成类似下面的格式"2017-03-06 20:30:10"
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String string = simpleDateFormat.format(new Date());
System.out.println(string);
}
//1.获取计算机的当前系统时间并打印出来,要求将时间格式转换成类似下面的格式"2017-03-06 20:30:10"
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String string = simpleDateFormat.format(new Date());
System.out.println(string);
}
原文:https://www.cnblogs.com/limin-java/p/8504411.html