Here you can find the source of dateAddMM(Date date, int i)
public static String dateAddMM(Date date, int i)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public final static String DATETIME_FORMAT_YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; public static String dateAddMM(Date date, int i) { Date currTime = addMM(date, i); SimpleDateFormat format = new SimpleDateFormat(DATETIME_FORMAT_YYYYMMDDHHMMSS); return format.format(currTime); }//from w w w . ja v a 2 s .c o m public static Date addMM(Date date, int i) { if (date == null) return null; Calendar c = new GregorianCalendar(); c.setTime(date); c.add(Calendar.MINUTE, i); return c.getTime(); } public static String addMM(int i) { Date currTime = addMM(getNowDate(), i); SimpleDateFormat format = new SimpleDateFormat(DATETIME_FORMAT_YYYYMMDDHHMMSS); return format.format(currTime); } public static Date getNowDate() { Calendar c = Calendar.getInstance(); return c.getTime(); } }