Java Utililty Methods Date Now

List of utility methods to do Date Now

Description

The list of methods to do Date Now are organized into topic(s).

Method

StringgetCurrentDate(boolean WithDelimeter)
get Current Date
if (WithDelimeter)
    return new SimpleDateFormat("yyyy/MM/dd").format(new Date());
return new SimpleDateFormat("yyyyMMdd").format(new Date());
DategetCurrentDate(Date date)
get Current Date
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
try {
    return df.parse(df.format(date));
} catch (ParseException e) {
    return date;
StringgetCurrentDate(final String form)
get Current Date
SimpleDateFormat formatter = new SimpleDateFormat(form);
java.util.Date currentDate = new java.util.Date();
return formatter.format(currentDate);
StringgetCurrentDate(final String FORMAT)
This method returns current date in specific format given
try {
    SimpleDateFormat sdf = new SimpleDateFormat(FORMAT);
    Calendar c = Calendar.getInstance();
    return sdf.format(c.getTime());
} catch (Exception e) {
    e.printStackTrace();
return "";
...
StringgetCurrentDate(String format)
get Current Date
return getDate(0, format);
StringgetCurrentDate(String format)
get Current Date
String curDateTime = null;
try {
    SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat(format);
    Calendar c = new GregorianCalendar();
    curDateTime = mSimpleDateFormat.format(c.getTime());
} catch (Exception e) {
    e.printStackTrace();
return curDateTime;
StringgetCurrentDate(String format)
get Current Date
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.SIMPLIFIED_CHINESE);
Date date = new Date();
String currentDate = sdf.format(date);
return currentDate;
StringgetCurrentDate(String format)
get Current Date
SimpleDateFormat t = new SimpleDateFormat(format);
return t.format(new Date());
StringgetCurrentDate(String format)
get Current Date
return new SimpleDateFormat(format).format(new Date());
StringgetCurrentDate(String format)
get Current Date
return new SimpleDateFormat(format).format(new Date());