Here you can find the source of getCurrentDate()
public static String getCurrentDate()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCurrentDate() { String format = "yyyy-MM-dd"; return formatDate(format); }//from w w w . j a v a 2 s . c om private static String formatDate(String format) { Date date = new Date(); return formatDate(date, format); } private static String formatDate(Date date, String format) { String str = ""; SimpleDateFormat dateformat = new SimpleDateFormat(format); str = dateformat.format(date); return str; } }