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
return new SimpleDateFormat(YYYYMMDDHHMMSS_FORMAT).format(new Date());
StringgetNow(boolean ifdatetime)
get Now
java.util.Date dd = new java.util.Date();
java.text.SimpleDateFormat df = null;
String rtn = "";
if (ifdatetime) {
    df = new java.text.SimpleDateFormat(STRING_DATE_FORMAT);
} else {
    df = new java.text.SimpleDateFormat(DATE_FORMAT);
rtn = df.format(dd);
return rtn;
StringgetNow(final String format)
get Now
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(new Date());
StringgetNow(String format)
get Now
return dateToString(new Date(), format);
StringgetNowAsNICSDate()
get Now As NICS Date
return getTimeFromMillisAsNICSDate(getNowAsMillis());
StringgetNowAsString()
get Now As String
Calendar cal = Calendar.getInstance();
SimpleDateFormat ISO8601Local = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
TimeZone timeZone = TimeZone.getDefault();
ISO8601Local.setTimeZone(timeZone);
return ISO8601Local.format(cal.getTime());
DategetNowDateTime()
get Now Date Time
return Calendar.getInstance().getTime();
StringgetNowDateTime()
get Now Date Time
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
return dateFormat.format(new Date());
StringgetNowDateTime()
get Now Date Time
return getFormatNowDateTime("yyyy-MM-dd HH:mm:ss");
StringgetNowDateTime()
Gets the now date time.
GregorianCalendar gcNow = new GregorianCalendar();
java.util.Date dNow = gcNow.getTime();
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM,
        Locale.SIMPLIFIED_CHINESE);
return df.format(dNow);