Java Minute Calculate getFutureDate(int _minutes)

Here you can find the source of getFutureDate(int _minutes)

Description

get Future Date

License

Open Source License

Parameter

Parameter Description
_minutes How many minutes the returned should lie in the future.

Return

currentDate + _minutes

Declaration

public static String getFutureDate(int _minutes) 

Method Source Code

//package com.java2s;
/**/*from   w w  w .j av a  2s. c  o  m*/
 * identity_provider - to.networld.security.common
 *
 * Copyright (C) 2010 by Networld Project
 * Written by Alex Oberhauser <oberhauseralex@networld.to>
 * All Rights Reserved
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation, version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this software.  If not, see <http://www.gnu.org/licenses/>
 */

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    /**
     * @param _minutes How many minutes the returned should lie in the future.
     * @return currentDate + _minutes
     */
    public static String getFutureDate(int _minutes) {
        SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE) + _minutes);
        return dateFormatter.format(cal.getTime());
    }
}

Related

  1. diffOfMinutes(String begin, String end)
  2. formatDateMinutes(Date myDate, String pattern)
  3. getAlarmMinutes(String dtStart, String dtAlarm, Logger logger)
  4. getCurrCustomMinuteDate(String formatStr, int changeMinute)
  5. getForwardTimeByMinute(int minute, String format)
  6. getIntevalMinutes(String startDate, String endDate)
  7. getTime(int minuteDelt)
  8. getTimeAddMinute(String time, int minute)
  9. getTimeInDate(int offSetInMinutes)