List of utility methods to do Date Format
String | formatDate(Date date) Method description return formatDate(date, null);
|
String | formatDate(Date date) format Date return formatDate(date, "yyyy-MM-dd"); |
String | formatDate(Date date) Formats a standard Java date into the MOCA date String (YYYYMMDDHHmmss) format. if (date == null) return null; DateFormat tmp = (DateFormat) _dateFormat.clone(); return tmp.format(date); |
String | formatDate(Date date) format date with the default pattern SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT); return format.format(date); |
String | formatDate(Date date) Formats a Date object to return a date using the global locale. SimpleDateFormat outFormat = new SimpleDateFormat("yyyy-MM-dd"); return outFormat.format(date); |
String | formatDate(Date date) Converts Date to String. SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); return sdf.format(date); |
String | formatDate(Date date) Formats the date, returns a string in the format 2020-12-31T23:59:59.123Z return new SimpleDateFormat(DATE_FORMAT).format(date); |
String | formatDate(Date date, DateFormat dateFormat, char delimiter, boolean endWithDelimiter) Formats the date according to the specified format and returns as a string. Calendar cal = Calendar.getInstance(dateFormat.getTimeZone(), Locale.ENGLISH); cal.setTime(date); int offset = getOffsetInMinutes(cal); StringBuilder sb = new StringBuilder(dateFormat.format(date)); appendOffset(sb, delimiter, offset, endWithDelimiter); return sb.toString(); |
String | formatDate(Date date, Locale locale) format Date if (date == null) { return null; DateFormat format = DateFormat.getDateInstance(DateFormat.FULL, locale); return format.format(date); |
String | formatDate(Date date, SimpleDateFormat dateFormat) format Date if (date != null) { return dateFormat.format(date); } else { return null; |