Java Minute Calculate countTimeAfter(String date, int minute)

Here you can find the source of countTimeAfter(String date, int minute)

Description

count Time After

License

Apache License

Declaration

public static String countTimeAfter(String date, int minute) throws Exception 

Method Source Code


//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);
    }
}

Related

  1. addOrRemoveMinutes(String set, int minutesBeforeSunset)
  2. compareDateEndWithMinute(Date d1, Date d2)
  3. diffOfMinutes(String begin, String end)
  4. formatDateMinutes(Date myDate, String pattern)
  5. getAlarmMinutes(String dtStart, String dtAlarm, Logger logger)
  6. getCurrCustomMinuteDate(String formatStr, int changeMinute)