List of utility methods to do Date Now
String | getCurrentTime() get Current Time java.util.Calendar cal = java.util.Calendar.getInstance(); return new java.text.SimpleDateFormat(TIME_FORMAT).format(cal.getTime()); |
String | getCurrentTime() get Current Time Calendar calendar = Calendar.getInstance(Locale.CHINESE); calendar.setTimeInMillis(new Date().getTime()); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); return dateFormat.format(calendar.getTime()); |
String | getCurrentTime() This method is used to current time Date currentTimeStamp = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); return dateFormat.format(currentTimeStamp); |
String | getCurrentTime() get Current Time return getCurrentDateTime(FORMAT5);
|
String | getCurrentTime() get Current Time SimpleDateFormat fmt = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", Locale.US); fmt.setTimeZone(TimeZone.getTimeZone("GMT")); return fmt.format(new Date()); |
String | getCurrentTime(Date _d) get Current Time SimpleDateFormat formatter = new SimpleDateFormat("HHmmss"); return formatter.format(_d); |
Date | getCurrentTime(long delay, long interval) get Current Time long current = System.currentTimeMillis(); SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); long date = 0; try { date = sf.parse(sf.format(new Date())).getTime(); current = System.currentTimeMillis() - date - delay; } catch (ParseException e) { return new Date(date + delay + (current / interval) * interval); |
String | getCurrentTime(String format) get Current Time int millisPerHour = 60 * 60 * 1000; SimpleDateFormat fmt = new SimpleDateFormat(format); SimpleTimeZone timeZone = new SimpleTimeZone(9 * millisPerHour, "KST"); fmt.setTimeZone(timeZone); String str = fmt.format(new java.util.Date(System.currentTimeMillis())); return str; |
String | getCurrentTime(String format) get Current Time if (format == null || format.trim().equals("")) { sdf.applyPattern(FORMAT_DATE_TIME); } else { sdf.applyPattern(format); return sdf.format(new Date()); |
String | getCurrentTime(String format) get Current Time long time = System.currentTimeMillis(); SimpleDateFormat dayTime = new SimpleDateFormat(format); String currentTime = dayTime.format(new Date(time)); return currentTime; |