List of utility methods to do Date Format
String | formatDate(Date date, String pattern, Locale locale) format Date SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale); return dateFormat.format(date); |
String | format(Date d, String dateFormat) format final SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(d); |
String | getShortFriendlyDate(Date dt) get Short Friendly Date String dtStr = DateFormat.format("MMM d, yyyy", dt).toString(); Date today = getToday(); String todayStr = DateFormat.format("MMM d, yyyy", today) .toString(); if (dtStr.equals(todayStr)) { return "Today"; Date yesterday = getYesterday(); ... |
String | getFormatDateString(String format) get Format Date String java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat( format); java.util.Date d = new java.util.Date(); return sdf.format(d); |
String | getFormatDateString(String format, java.util.Date date) get Format Date String java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat( format); return sdf.format(date); |
String | getFormatDateTime(String formatString, Date d) get Format Date Time SimpleDateFormat sdf = new SimpleDateFormat(formatString, Locale.ENGLISH); return sdf.format(d); |
String | formatDateToString(Date timestamp) Konvertiert ein Date-Objekt in eine lesbare Zeitangabe (als String) return new SimpleDateFormat(CLIENT_DATE_FORMAT).format(timestamp); |
String | getStringByFormat(Date date, String format) get String By Format SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat(format); String strDate = null; try { strDate = mSimpleDateFormat.format(date); } catch (Exception e) { e.printStackTrace(); return strDate; ... |
String | getStringByFormat(Date date, String format) get String By Format SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat(format); String strDate = null; try { strDate = mSimpleDateFormat.format(date); } catch (Exception e) { e.printStackTrace(); return strDate; ... |
String | convertDateToString(Date date) convert Date To String String result = ""; SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); try { result = format.format(date); } catch (Exception e) { e.printStackTrace(); return result; |