Here you can find the source of getMinuteAfter(Date date, int minute)
public static String getMinuteAfter(Date date, int minute)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.text.SimpleDateFormat; public class Main { public static final String dtLong = "yyyyMMddHHmmss"; public static String getMinuteAfter(Date date, int minute) { Calendar now = Calendar.getInstance(Locale.CHINA); now.setTime(date);/*from www . j a v a 2 s . c om*/ if (minute > 0) { now.set(Calendar.MINUTE, now.get(Calendar.MINUTE) + minute); } now.set(Calendar.MINUTE, now.get(Calendar.MINUTE)); SimpleDateFormat format = new SimpleDateFormat(dtLong); return format.format(now.getTime()); } }