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

DategetCurrentDate()
get Current Date
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String date = format.format(new Date());
try {
    return format.parse(date);
} catch (ParseException e) {
    e.printStackTrace();
return null;
...
StringgetCurrentDate()
get Current Date
return formatDateTime(SIMPLE_DATE_FROMAT, new Date());
StringgetCurrentDate()
Returns the current date in Cordys format.
String returnValue = null;
SimpleDateFormat targetFormat = new SimpleDateFormat(CORDYS_DATE_FORMAT);
returnValue = targetFormat.format(new Date());
return returnValue;
StringgetCurrentDate()
get current date
Format formatter = new java.text.SimpleDateFormat("yyyyMMddHHmmss");
return formatter.format(new Date());
StringgetCurrentDate()
get Current Date
String date = getCurrentDate("yyyyMMdd");
return date;
StringgetCurrentDate()
Get the current date string as "yyyyMMdd".
SimpleDateFormat pattern = new SimpleDateFormat("yyyyMMdd");
Calendar now = Calendar.getInstance();
pattern.setCalendar(now);
return pattern.format(now.getTime());
StringgetCurrentDate()
get Current Date
return getCurrentDateTime().substring(0, 11);
StringgetCurrentDate()
Returns the current date in the format that matches this#getDateFormat()
return new SimpleDateFormat(getDateFormat()).format(new Date(System.currentTimeMillis()));
StringgetCurrentDate()
get Current Date
return DATE_FORMATER.format(System.currentTimeMillis());
StringgetCurrentDate()
get Current Date
DateFormat dateFormat = new SimpleDateFormat("ddMMyyyyHHmmss");
Date date = new Date();
return dateFormat.format(date);