List of utility methods to do Hour Format
String | formatDateInTime(Date date) format Date In Time return LOG_DATE_IN_HOUR_FORMAT.format(date);
|
String | formatDateRfc822(Date date, String timeZoneId) Format a Date in RFC822 with the given time zone. if (date != null) { TimeZone tZone = TimeZone.getTimeZone(timeZoneId); SimpleDateFormat dateFormater = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); dateFormater.setTimeZone(tZone); return dateFormater.format(date); return null; |
String | formatDateString(Date d) format Date String String dateFormat = "yyyyMMddHHmm"; java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(dateFormat); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); return sdf.format(d); |
String | formatDateString(String dateString) format Date String try { if ("".equals(dateString) || dateString == null) { return null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = sdf.parse(dateString); sdf.applyPattern("yyyy-MM-dd HH:mm:ss"); return sdf.format(date); ... |
String | formatDateString2(String str_date) format Date String String[] patterns = new String[6]; Pattern p0; Pattern p1; Pattern p2; Pattern p3; Pattern p4; Pattern p5; patterns[0] = "(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[012])/((\\d\\d)|((19|20)\\d\\d))\\s([1-9]|([01][0-9])|(2[1-3])):((0[0-9])|([12345][0-9])):((0[0-9])|([12345][0-9])).[0-9]*"; ... |
String | formatDateTime() format Date Time return formatDateTime(new Date(System.currentTimeMillis())); |
String | formatDateTime(Calendar cal) format Date Time synchronized (dtg) { if (cal == null) { return "unknown"; return dtg.format(cal.getTime()); |
String | formatDateTime(Calendar dateTime) format Date Time assert dateTime != null : "Parameter 'dateTime' of method 'formatDateTime' must not be null"; return DATE_TIME_FORMAT.format(new Date(dateTime.getTimeInMillis())); |
String | formatDateTime(Calendar time) format Date Time if (time == null) { return ""; DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm"); return df.format(time.getTime()); |
String | formatDateTime(Date d) Convert date and time to string like "yyyy-MM-dd HH:mm". return new SimpleDateFormat(DATETIME_FORMAT).format(d); |