Here you can find the source of getToDay(boolean withTime)
public static String getToDay(boolean withTime)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getToDay(boolean withTime) { String formatStr = "yyyy-MM-dd"; if (withTime) { formatStr += " HH:mm:ss"; }// ww w . j a v a 2s. c o m SimpleDateFormat datef = new SimpleDateFormat(formatStr); return datef.format(new Date()); } }