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

booleancurrentAfterDay(Date date)
current After Day
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
Calendar current = Calendar.getInstance();
current.set(Calendar.HOUR_OF_DAY, 0);
...
StringcurrentDate()
Get todays date in string form WITHOUT a time-stamp
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_DAY);
return sdf.format(cal.getTime());
StringcurrentDate()
current Date
return dateFormat.format(now());
DatecurrentDate()
current Date
return Calendar.getInstance().getTime();
DatecurrentDate()
Returns the current date at midnight (hours, minutes and seconds are omitted).
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
return cal.getTime();
DatecurrentDate()
current Date
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return new Date(calendar.getTimeInMillis());
StringcurrentDate()
Returns the current date formatted as EXIF timestamp.
return new SimpleDateFormat("yyyy:MM:dd HH:mm:ss", Locale.UK).format(Calendar.getInstance().getTime());
StringcurrentDate()
Formats the current date.
return dateToString(System.currentTimeMillis());
StringcurrentDate()
current Date
return dateFormat.format(now());
StringcurrentDate()
current Date
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
return dateFormat.format(new Date());