Here you can find the source of getTimeAddMinute(String time, int minute)
public static String getTimeAddMinute(String time, int minute)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static Calendar ca = Calendar.getInstance(); public static String getTimeAddMinute(String time, int minute) { ca.setTime(stdt(time));//from w ww . j a v a2s .c o m ca.add(Calendar.MINUTE, minute); return dtts(ca.getTime()); } public static Date getTimeAddMinute(Date time, int minute) { ca.setTime(time); ca.add(Calendar.MINUTE, minute); return ca.getTime(); } public static Date stdt(String str) { String _pattern = "yyyy-MM-dd HH:mm:ss"; return std(str, _pattern); } public static String dtts(Date date) { String _pattern = "yyyy-MM-dd HH:mm:ss"; return date == null ? null : dts(date, _pattern); } public static Date std(String str, String pattern) { Date dateTime = null; try { if (str != null && !str.equals("")) { SimpleDateFormat formater = new SimpleDateFormat(pattern); dateTime = formater.parse(str); } } catch (Exception ex) { } return dateTime; } public static Date std(String str) { String _pattern = "yyyy-MM-dd"; return std(str, _pattern); } public static String dts(Date date, String pattern) { String strDateTime = null; SimpleDateFormat formater = new SimpleDateFormat(pattern); strDateTime = date == null ? null : formater.format(date); return strDateTime; } public static String dts(Date date) { String _pattern = "yyyy-MM-dd"; return date == null ? null : dts(date, _pattern); } }