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 String GetToday() { Date cDate = new Date(); SimpleDateFormat cSimpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd"); return cSimpleDateFormat.format(cDate); }/*ww w. j ava 2 s. c om*/ public static String GetToday(String strFormat) { Date cDate = new Date(); SimpleDateFormat cSimpleDateFormat = new SimpleDateFormat(strFormat); return cSimpleDateFormat.format(cDate); } }