List of utility methods to do Time Now
String | getNowDateTime(String strScheme) get Now Date Time String strReturn = null; Date now = new Date(); try { SimpleDateFormat sdf = new SimpleDateFormat(strScheme); strReturn = sdf.format(now); } catch (Exception e) { strReturn = ""; return strReturn; |
String | getNowDateTimeStrConcise() get Now Date Time Str Concise return getDateTimeStrConcise(new Date()); |
Long | getNowDayTimeLong() get Now Day Time Long String nowDay = sdFormatDay.format(new Date()); return sdFormatDay.parse(nowDay).getTime(); |
String | getNowDefault() get Now Default return getNow("yyyyMMddHHmmss"); |
String | getNowFileFormat() Get current date/time - useful for filenames. Calendar cal = Calendar.getInstance(TimeZone.getDefault()); String DATE_FORMAT = "yyyy-MM-dd-HHmmssSSS"; java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT); sdf.setTimeZone(TimeZone.getDefault()); return sdf.format(cal.getTime()); |
String | getNowFormatLog() get Now Format Log String LOG_DATE_FORMAT = "yyyyMMdd HH:mm:ss"; java.util.Date dd = new java.util.Date(); java.text.SimpleDateFormat df = null; String rtn = ""; df = new java.text.SimpleDateFormat(LOG_DATE_FORMAT); rtn = df.format(dd); return rtn; |
String | getNowFormattedDateTimeStr(String pattern) get Now Formatted Date Time Str return getFormattedDateTimeStr(pattern, new Date()); |
String | getNowHour() get Now Hour SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); return sdf.format(new Date()); |
String | getNowInBanFormat() get Now In Ban Format return dateFormat.format(new Date()); |
String | getNowInputDate() get now day format : yyyyMMdd return timeToString(DATE_FORMAT_INPUT_PAGE, new Date()); |