Here you can find the source of getToday()
public final static String getToday()
//package com.java2s; /**/* w w w .j a v a 2 s . c om*/ * @copyright Copyright (C) 2014-2015 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 getToday() { String day = "", month = "", year = ""; Calendar current_cal = Calendar.getInstance(); int mm = (current_cal.get(Calendar.MONTH) + 1); int dd = current_cal.get(Calendar.DATE); year = "" + current_cal.get(Calendar.YEAR); if (mm < 10) month = "0"; month += mm; if (dd < 10) day = "0"; day += dd; return month + "/" + day + "/" + year; } }