Here you can find the source of getCurrentDate()
public static String getCurrentDate()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCurrentDate() { return getFormatDateTime(new Date(), "yyyy-MM-dd"); }// w w w . jav a 2s .c o m public static String getFormatDateTime(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); } }