List of utility methods to do Time Format
String | getStringFromTime(Date time, String format) get String From Time if (format == null || format.trim().equals("")) { sdf.applyPattern(FORMAT_DATE_TIME); } else { sdf.applyPattern(format); return sdf.format(time); |
String | getSysDateTimeForFileName() get Sys Date Time For File Name Calendar calendar = Calendar.getInstance(); SimpleDateFormat dateFormat = new SimpleDateFormat("dd_MM_yyyy_HH_mm"); try { return dateFormat.format(calendar.getTime()); } catch (Exception e) { throw e; |
String | getSysTimeYMDHMS2() get Sys Time YMDHMS return new SimpleDateFormat("yyyyMMddHHmmss").format(new Date(System.currentTimeMillis())); |
long | getTime(@Nonnull String format, @Nonnull String date, @Nonnull String tz) get Time checkNotNull(format); checkNotNull(date); checkNotNull(tz); try { DateFormat dateFormat = new SimpleDateFormat(format); dateFormat.setTimeZone(TimeZone.getTimeZone(tz)); return dateFormat.parse(date).getTime(); } catch (ParseException e) { ... |
String | getTime(Date dt, String format) get Time SimpleDateFormat st = new SimpleDateFormat(format); return st.format(dt); |
String | getTime(Date time, int format, Locale locale) get Time return SimpleDateFormat.getTimeInstance(format, locale).format(time);
|
String | getTime(DateFormat df) get Time return df.format(new Date()); |
String | getTime(int format) get Time if (format == 0) { return FORMAT4NAME.format(new Date()); } else { return FORMAT4LOG.format(new Date()); |
String | getTime(long time, int timeFormat) get Time return timeFormat == HOURS_24_MAKE ? getTimeOf24(time) : getTimeOf12(time);
|
long | getTime(String dateStr, String format) get Time long time = -1; Date date = getDate(dateStr, format); if (date != null) { time = getDate(dateStr, format).getTime(); return time; |