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