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

StringgetCurrSysTime()
get Curr Sys Time
Date date = new Date();
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sf.format(date);
StringgetCurrTime()
get Curr Time
Date now = new Date();
SimpleDateFormat outFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String s = outFormat.format(now);
return s;
StringgetCurrTime()
get Curr Time
Date now = new Date();
SimpleDateFormat outFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String s = outFormat.format(now);
return s;
StringgetCurTime()
get Cur Time
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat(time_pattern);
return format.format(date);
StringgetCurTimeStr()
get Cur Time Str
Calendar cal = Calendar.getInstance();
String curDate = DATE_FORMATER.get().format(cal.getTime());
return curDate;
StringgetDBCurrentTime()
Returns current date/time in ORACLE format
String dbFormat = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(dbFormat);
return (sdf.format(new Date()));
StringgetLogCurrentTime()
get Log Current Time
Date current = new Date(System.currentTimeMillis());
return logFormat.format(current);
StringgetNow()
get Now
return getDate(new Date());
StringgetNow()
get Now
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd H:mm:ss");
Date nowc = new Date();
String pid = formatter.format(nowc);
return pid;
StringgetNow()
get Now
SimpleDateFormat sdf = new SimpleDateFormat(_16DIGIT_DATE_TIME);
return sdf.format(getTimezoneDate(_DEFAULT_TIMEZON));