Here you can find the source of formatDateToday()
public static String formatDateToday()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); public static String formatDateToday() { return formatDate(new Date()); }//from w w w . ja v a2 s .com public static String formatDate(Date date) { return DATE_FORMAT.format(date); } public static String format(Date date) { return FORMAT.format(date); } }