Here you can find the source of countTimeAfter(String date, int minute)
public static String countTimeAfter(String date, int minute) throws Exception
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String countTimeAfter(String date, int minute) throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm"); long ret = sdf.parse(date).getTime() + minute * 60 * 1000; Date now = sdf.parse(date); now.setTime(ret);/*w w w . ja va 2s. c o m*/ return sdf.format(now); } }