Here you can find the source of getToday()
public static String getToday()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getToday() { return getDate(0); }// w w w . j a v a2s . c o m public static String getDate(int days) { Calendar currentTime = Calendar.getInstance(); currentTime.add(Calendar.DATE, days); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.format(currentTime.getTime()); } }