List of utility methods to do Time Get
String | getCurrentlyDateTime() get Currently Date Time SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); return dateFormat.format(new Date()); |
long | now() now return Calendar.getInstance().getTimeInMillis();
|
String | getTimeStamp() get Time Stamp return String.valueOf(System.currentTimeMillis() / 1000);
|
String | getTimeString(long time) get Time String return dateFormat.format(new Date(time)); |
String | getTimestamp() get Timestamp SimpleDateFormat sdf = new SimpleDateFormat( "[yyyy-MM-dd EEE HH:mm]"); return sdf.format(new Date()); |
long | getCurrentTime() Get the current time in seconds since January 1, 1970 time.setToNow(); long now = time.toMillis(false) / 1000; return now; |
String | getCurrentTime() get Current Time Date date = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); String text = sdf.format(date); return text; |
String | getCurrentTimeStamp() get Current Time Stamp Date date = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String text = sdf.format(date); return text; |
Calendar | getNow() get Now Calendar c = Calendar.getInstance();
return c;
|
Calendar | getNow() get Now GregorianCalendar now = new GregorianCalendar(); Calendar dateNow = new GregorianCalendar(now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH)); return dateNow; |