Here you can find the source of today(String strFormat)
public static String today(String strFormat)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String today(String strFormat) { return toString(new Date(), strFormat); }//from w w w. j a v a 2 s . co m public static String toString(Date date, String format) { return getSimpleDateFormat(format).format(date); } private static SimpleDateFormat getSimpleDateFormat(String strFormat) { if (strFormat != null && !"".equals(strFormat.trim())) { return new SimpleDateFormat(strFormat); } else { return new SimpleDateFormat(); } } }