Here you can find the source of getToday()
public static String getToday()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String _8DIGIT_DATE_2 = "yyyy-MM-dd"; public static String getToday() { SimpleDateFormat sdf = new SimpleDateFormat(_8DIGIT_DATE_2); return sdf.format(new Date()); }/*from w w w . j a v a 2 s. c o m*/ public static String format(Date aDate, String type) { SimpleDateFormat sdf = new SimpleDateFormat(type); return sdf.format(aDate); } public static String format(Long dateMs, String type) { Date date = new Date(dateMs); SimpleDateFormat sdf = new SimpleDateFormat(type); return sdf.format(date); } }