public static void main(String[] args) {
//获取日期时间
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ZoneId zoneId = ZoneId.ofOffset("GMT", ZoneOffset.ofHours(8));
TimeZone timeZone = TimeZone.getTimeZone(zoneId);
df.setTimeZone(timeZone);
String date = df.format(new Date(System.currentTimeMillis()));
System.out.println(date);
}