Java Utililty Methods Time Now

List of utility methods to do Time Now

Description

The list of methods to do Time Now are organized into topic(s).

Method

StringgetNow()
get Now
SimpleDateFormat sdf = new SimpleDateFormat(_16DIGIT_DATE_TIME);
return sdf.format(new Date());
StringgetNow()
get Now
return getNow("yyyy-MM-dd");
StringgetNow()
Get the current timestamp
final Calendar cal = Calendar.getInstance(TimeZone.getDefault());
final String DATE_FORMAT = "yyyy-MM-dd_HH-mm-ss"; 
final java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT);
sdf.setTimeZone(TimeZone.getDefault());
return sdf.format(cal.getTime());
StringgetNow()
Get date string as format of "yyyy-MM-dd HH:mm:ss.SSS"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
sdf.setTimeZone(getDefaultTimeZone());
return sdf.format(getCalendar().getTime());
StringgetNow()
get Now
return FORMATTER.format(Calendar.getInstance().getTime());
DategetNow()
get Now
Date now = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
    return dateFormat.parse(dateFormat.format(now));
} catch (ParseException e) {
    return null;
StringgetNow()
get Now
return getISOFormat(new java.util.Date());
StringgetNow()
get Now
return formatDateTime(new Date());
StringgetNow()
get Now
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date today = new Date();
return format.format(today);
DategetNow()
get Now
return new Date();