Here you can find the source of getAfterMin(Date date, int min)
public static Date getAfterMin(Date date, int min)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getAfterMin(Date date, int min) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date);/*from w ww .j a v a 2 s . com*/ calendar.set(Calendar.MINUTE, calendar.get(Calendar.MINUTE) + min); return calendar.getTime(); } public static synchronized Date getTime(final long millis) { Date date = new Date(); if (millis > 0) { date.setTime(millis); } return date; } }