Here you can find the source of getCurrentDate(String format)
public static String getCurrentDate(String format)
//package com.java2s; // LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCurrentDate(String format) { return new SimpleDateFormat(format).format(new Date()); }/*from ww w .ja v a 2 s .c o m*/ }