Here you can find the source of getFutureDate(int _minutes)
Parameter | Description |
---|---|
_minutes | How many minutes the returned should lie in the future. |
public static String getFutureDate(int _minutes)
//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()); } }