Here you can find the source of getCurrentDay()
public static String getCurrentDay()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCurrentDay() { return getDefaultDateFormat().format(java.util.Calendar.getInstance().getTime()); }/*from www . j a v a2 s . c o m*/ public static String format(Date date, String formatPattern) { if (date == null) { return ""; } else { return new SimpleDateFormat(formatPattern).format(date); } } public static SimpleDateFormat getDefaultDateFormat() { return new SimpleDateFormat("yyyyMMdd"); } }