List of utility methods to do Time Format
String | getFormatTimeString(Date date, String pattern) get Format Time String SimpleDateFormat sDateFormat = getDateFormat(pattern); synchronized (sDateFormat) { return sDateFormat.format(date); |
DateFormat | getFullDateTimeFormat() Gets the full datetime formatter. return FULL_DATETIME_FORMAT;
|
String | getFullTime(String format, Date date) get Full Time SimpleDateFormat dateFormat = new SimpleDateFormat(format); return dateFormat.format(date); |
String | getGenerationTime(String format) generate current time SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.US); String sysdate = formatter.format(new Date()); return sysdate; |
int | getIntegerDateTime(Date date, String dateFormat) get Integer Date Time SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); int dateTime = Integer.parseInt(sdf.format(date.getTime())); return dateTime; |
String | getShowTime(Date date, String format) get Show Time SimpleDateFormat df = new SimpleDateFormat(format); if (date == null) { return ""; } else { return df.format(date); |
SimpleDateFormat | getStartTimeFormatter() get Start Time Formatter return startTimeFormatter.get();
|
String | getStrDateByFormat(Date time, String format) get Str Date By Format SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); if (time == null) { return ""; if (format == null || format.equals("")) { return dateFormat.format(time); } else { SimpleDateFormat f = new SimpleDateFormat(format); ... |
String | getStrDateTime() get Str Date Time return getStrDateTime(new Date()); |
String | getStringFormatFromDateTime(long pDateTime, String format) formats the supplied time in millis to the one specifiedin the format. format = format != null ? format : "dd-MM-yyyy HH:mm:ss Z"; SimpleDateFormat dateFormat = new SimpleDateFormat(format, Locale.ENGLISH); dateFormat.setTimeZone(getServerTimeZone()); return dateFormat.format(new Date(pDateTime)); |