实现代码如下:
public static void main(String[] args) throws ParseException {
System.out.println(getTime("12:01",20));// 12:01分加上20分钟得到12:21}
/**
* 一个时间点加上一段分钟数得到新的时间点
* @param date 时分
* @param handleTime 处理时间:分钟
* @return
* @throws ParseException
*/
public static String getTime(String date,int handleTime) throws ParseException{
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
Date now = sdf.parse(date);
Date afterDate = new Date(now .getTime() + handleTime*60*1000);
return sdf.format(afterDate);
}