JAVA获取当前时间

SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //设置时间的格式化

df.setTimeZone(TimeZone.getTimeZone("Etc/GMT-8")); //设置时间的区位
System.out.println(df.format(new Date()));//获取当前系统的时间
原文地址:https://www.cnblogs.com/a709898670/p/9474501.html