List of utility methods to do Time Get
String | now() now Calendar cal = Calendar.getInstance();
return sDefaultDateFormat.format(cal.getTime());
|
String | getCompactTime() get Compact Time Date curDate = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); String result = sdf.format(curDate); return result; |
long | getCurrentEpochTime() get Current Epoch Time return new Date().getTime(); |
long | getCurrentTime() get Current Time Time t = new Time(); t.setToNow(); return t.toMillis(true); |
String | getDateTime() get Date Time SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss", Locale.getDefault()); Date date = new Date(); return dateFormat.format(date); |
String | getLongTime() get Long Time Date curDate = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmssSSS"); String result = sdf.format(curDate); return result; |
int | getRequestTime() get Request Time return requestTime;
|
String | getSystemTime() get System Time Calendar c = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String formattedDate = df.format(c.getTime()); return formattedDate; |
String | getTime1() get Time java.util.Date date1 = new java.util.Date(); return date1.toString(); |
long | getTimeInMillis() Method returns the current time as [local timezone] milliseconds. return Calendar.getInstance().getTimeInMillis();
|