Here you can find the source of getDateOneYearFromNow()
public final static String getDateOneYearFromNow()
//package com.java2s; /**/*from w ww.j av a 2s . c o m*/ * @copyright Copyright (C) 2014-2016 City of Bloomington, Indiana. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt * @author W. Sibo <sibow@bloomington.in.gov> * */ import java.util.*; public class Main { public final static String getDateOneYearFromNow() { String day = "", month = "", year = ""; Calendar cal = Calendar.getInstance(); cal.add(Calendar.YEAR, 1); int mm = (cal.get(Calendar.MONTH) + 1); int dd = cal.get(Calendar.DATE); year = "" + cal.get(Calendar.YEAR); if (mm < 10) month = "0"; month += mm; if (dd < 10) day = "0"; day += dd; return month + "/" + day + "/" + year; } }