Here you can find the source of plusMinute(Date date, int minutes)
public static Date plusMinute(Date date, int minutes)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.*; public class Main { private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static Date plusMinute(Date date, int minutes) { if (date == null) date = getToday();//from w ww. j av a2s .c o m return changeMinute(date, minutes); } public static Date getToday() { return new Date(); } private static Date changeMinute(Date date, int minutes) { Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.MINUTE, minutes); return cal.getTime(); } public static String getTime() { return sdfTime.format(new Date()); } }