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 date = getCurrentDate("yyyyMMdd"); return date; }//ww w.jav a 2s .c o m public static String getCurrentDate(String pattern) { SimpleDateFormat formatter = new SimpleDateFormat(pattern); String date = formatter.format(new Date()); return date; } }