List of utility methods to do Date Now
String | getCurrentTime(String format) get Current Time return timeToString(System.currentTimeMillis(), format);
|
String | getCurrentTime(String format) get Current Time Calendar cal = new GregorianCalendar(); SimpleDateFormat date_format = new SimpleDateFormat(format); return date_format.format(cal.getTime()); |
String | getCurrentTime(String formatter) get system time with a formatter SimpleDateFormat fmt = new SimpleDateFormat(formatter); fmt.setTimeZone(getTimeZone()); return fmt.format(new java.util.Date(System.currentTimeMillis())); |
String | getCurrentTime(String pattern) get Current Time return parseDate2String(new Date(), pattern); |
String | getCurrentTime(String pattern) get Current Time if ("".equals(pattern) || null == pattern) { pattern = "yyyy-MM-dd HH:mm:ss"; DateFormat df = new SimpleDateFormat(pattern); return df.format(new Date()); |
String | getCurrentTime(String pattern) get Current Time SimpleDateFormat format = getDateFormat(pattern); return format.format(new Date()); |
String | getCurrentTime(String pattern) Get current time for pattern. SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); return dateFormat.format(new Date()); |
String | getCurrentTime(String timeFormat) get Current Time if (timeFormat == null) { timeFormat = "MM/dd/yyy hh:mm:ss"; return new SimpleDateFormat(timeFormat).format(new Date()); |
String | getCurrentTime2MysqlDateTime() get Current Time Mysql Date Time java.util.Date dt = new java.util.Date(); java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String currentTime = sdf.format(dt); return currentTime; |
String | getCurrentTimeAndDate() Returns the current time and date in a formatted string. return java.text.DateFormat.getDateTimeInstance().format(new java.util.Date()); |