Here you can find the source of getToday()
public static String getToday()
//package com.java2s; /* Copyright 2014-2016, hbz. Licensed under the Eclipse Public License 1.0 */ import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { /**//from w w w . jav a2 s . com * @return a String representing today in yyyy-MM-dd format */ public static String getToday() { String dateFormat = "yyyy-MM-dd"; Calendar calender = Calendar.getInstance(); SimpleDateFormat simpleDate = new SimpleDateFormat(dateFormat); return simpleDate.format(calender.getTime()); } }