Java Date After getAfterMin(Date date, int min)

Here you can find the source of getAfterMin(Date date, int min)

Description

get After Min

License

Apache License

Declaration

public static Date getAfterMin(Date date, int min) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date getAfterMin(Date date, int min) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/*from w  ww .j  a  v  a  2  s . com*/
        calendar.set(Calendar.MINUTE, calendar.get(Calendar.MINUTE) + min);
        return calendar.getTime();
    }

    public static synchronized Date getTime(final long millis) {
        Date date = new Date();
        if (millis > 0) {
            date.setTime(millis);
        }
        return date;
    }
}

Related

  1. getAfter(Date comparedDate, int cursor, String unit)
  2. getAfterDay(Date date, int afterDays)
  3. getAfterDay(Date date, Integer day)
  4. getAfterDayNumber(Date endDate, Date startDate)
  5. getAfterEndDate(Integer day)
  6. getDateAfter(Date d, int day)
  7. getDateAfter(Date date, int days)
  8. getDateAfter(Date date, int increment)
  9. getDateAfterAddition(Date date, int days)