Java Date to Minute minuteAdd(Date date, int val)

Here you can find the source of minuteAdd(Date date, int val)

Description

minute Add

License

Apache License

Declaration

public static Date minuteAdd(Date date, int val) 

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 minuteAdd(Date date, int val) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/*  w w  w .  j  av  a  2 s  .co  m*/
        calendar.add(Calendar.MINUTE, val);
        date = calendar.getTime();
        return date;
    }
}

Related

  1. getMinutes(final Date date)
  2. getMinutesInDay(Date d)
  3. getMinutesOfHour(Date dt)
  4. minute(Date date)
  5. minute(final Date date)
  6. minuteDate(Date date, int num)
  7. minuteOf(Date date)