List of utility methods to do Today
String | Today() 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); |
Date | today() Get the current date value. return today(DATEFORMAT_YYYYMMDD);
|
Date | today() today return roundDate(now());
|
Date | today() today return clearTime(new Date()); |
String | today() 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; |
String | today() today return yyyyMMdd.format(new java.util.Date()); |
Calendar | today() 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;
|
Date | today() Return a date, set to midnight of the current local day. final Calendar cal = Calendar.getInstance(); setMidnight(cal); return cal.getTime(); |
Calendar | today() today return date(now());
|
String | today() 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)); |