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

StringgetCurrentDay()
get Current Day
return format(new Date(), DEFAULT_PATTERN);
StringgetCurrentDay()
get Current Day
return getDefaultDateFormat().format(java.util.Calendar.getInstance().getTime());
CalendargetCurrentDay()
get Current Day
Calendar cal = Calendar.getInstance();
return cal;
StringgetCurrentDay()
get Current Day
return getDefaultDateFormat().format(java.util.Calendar.getInstance().getTime());
StringgetCurrentDay(int model)
get Current Day
return getDateStringForFormat(model == 0 ? "d" : "dd");
StringgetCurrentDay(String pattern)
get Current Day
SimpleDateFormat simpleFormate = new SimpleDateFormat(pattern);
return simpleFormate.format(new Date());
DategetCurrentDayBegin()
get Current Day Begin
Calendar calendar = new GregorianCalendar();
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
return calendar.getTime();
StringgetCurrentDayInyyyyMMdd()
getCurrentDayInyyyyMMdd: returns the current day.
return new SimpleDateFormat("yyyyMMdd").format(new java.util.Date());
StringgetCurrentFormattedTime()
get Current Formatted Time
return getFormattedTime(new Date());
DategetCurrentGMTTime()
get current GMT time
return getGMTTime(getTime());