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 getFormatCurrentTime("dd"); }//w w w . j av a 2 s . co m public static String getFormatCurrentTime(String format) { return getFormatDateTime(new Date(), format); } public static String getFormatDateTime(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); } }