Java Utililty Methods Today

List of utility methods to do Today

Description

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

Method

StringToday()
Get the current date.
Calendar now = Calendar.getInstance();
return formatNumber("00", now.get(Calendar.MONTH) + 1) + "/"
        + formatNumber("00", now.get(Calendar.DAY_OF_MONTH)) + "/"
        + formatNumber("00", now.get(Calendar.YEAR) % 100);
Datetoday()
Get the current date value.
return today(DATEFORMAT_YYYYMMDD);
Datetoday()
today
return roundDate(now());
Datetoday()
today
return clearTime(new Date());
Stringtoday()
today
final String myNow = formatNumber((Calendar.getInstance().get(Calendar.YEAR)), 4)
        + formatNumber((Calendar.getInstance().get(Calendar.MONTH) + 1), 2)
        + formatNumber((Calendar.getInstance().get(Calendar.DAY_OF_MONTH)), 2);
return myNow;
Stringtoday()
today
return yyyyMMdd.format(new java.util.Date());
Calendartoday()
today
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal;
Datetoday()
Return a date, set to midnight of the current local day.
final Calendar cal = Calendar.getInstance();
setMidnight(cal);
return cal.getTime();
Calendartoday()
today
return date(now());
Stringtoday()
today
synchronized (cal) {
    cal.setTime(new Date());
    return String.format("%04d%02d%02d", cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1,
            cal.get(Calendar.DAY_OF_MONTH));