日期需要加8小时
public static Date add8HoursToDate(Date date) {
// 创建一个日历对象
Calendar calendar = Calendar.getInstance();
// 设置日历的时间为日期对象的时间
calendar.setTime(date); // 使用add方法将日历的时间增加8小时 calendar.add(Calendar.HOUR_OF_DAY, 8);
// 从日历对象中获取增加后的日期时间
Date result = calendar.getTime(); return result; }