java中给当前时间添加一小时
public class DateUtil {
public static Date getDate(Date date){
Calendar cal = Calendar.getInstance();
cal.setTime(date);
// 24小时制
cal.add(Calendar.HOUR, 1);
return cal.getTime();
}
}
public class DateUtil {
public static Date getDate(Date date){
Calendar cal = Calendar.getInstance();
cal.setTime(date);
// 24小时制
cal.add(Calendar.HOUR, 1);
return cal.getTime();
}
}