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

Datetoday()
Returns a trimmed version of today's date
return trimDate(new Date());
Datetoday()
Returns a date with the current day (no time).
return stripTime(now());
Datetoday()
today
return truncate(new Date());
Datetoday()
today
java.util.Calendar now = java.util.Calendar.getInstance();
return dateForYMDHMS(now.get(java.util.Calendar.YEAR), now.get(java.util.Calendar.MONTH) + 1,
        now.get(java.util.Calendar.DATE), 0, 0, 0);
Datetoday()
today
Calendar date = Calendar.getInstance();
date.set(Calendar.HOUR_OF_DAY, 0);
date.set(Calendar.MINUTE, 0);
date.set(Calendar.SECOND, 0);
date.set(Calendar.MILLISECOND, 0);
return date.getTime();
Stringtoday()
today
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = new Date();
return dateFormat.format(date);
Datetoday()
today
return parse(format(new Date(), webFormat), webFormat);
Datetoday()
today
final Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.set(Calendar.HOUR, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
Calendartoday()
today
return Calendar.getInstance();
DatetoDay()
to Day
return removeTime(new Date());