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

DategetToday()
get Today
Calendar cal = Calendar.getInstance();
return cal.getTime();
StringgetToday()
Get date string as format of "yyyy-MM-dd"
return getDefaultDateFormatter().format(getCalendar().getTime());
StringgetToday()
get Today
java.util.Calendar cal = java.util.Calendar.getInstance();
return new java.text.SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
StringgetToday()
get Today
Calendar now = Calendar.getInstance();
StringBuffer sb = new StringBuffer();
sb.append(now.get(Calendar.YEAR)).append(now.get(Calendar.MONTH) + 1)
        .append(now.get(Calendar.DAY_OF_MONTH));
return sb.toString();
CalendargetToday()
This method returns the current date in the format: MM/dd/yyyy
Date today = new Date();
SimpleDateFormat df = new SimpleDateFormat(datePattern);
String todayAsString = df.format(today);
Calendar cal = new GregorianCalendar();
cal.setTime(convertStringToDate(todayAsString));
return cal;
StringgetToday()
get Today
SimpleDateFormat sdf = new SimpleDateFormat(_8DIGIT_DATE_2);
return sdf.format(getTimezoneDate(_DEFAULT_TIMEZON));
StringGetToday()
Get Today
Date cDate = new Date();
SimpleDateFormat cSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
return cSimpleDateFormat.format(cDate);
StringgetToday()
get Today
return toString(new Date(), PATTERN_YYYYMMDD);
StringgetToday()
get Today
String operationtime = dateFormat.format(new java.util.Date(date.getTime()));
return operationtime;
DategetToday()
get Today
return new Date();