Here you can find the source of getTodayStr()
public static String getTodayStr()
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTodayStr() { DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); String todayAsString = df.format(new Date()); return todayAsString; }//from w w w. java 2s . c o m }