List of utility methods to do yyyy
String | formatDate(Date date, String outputPattern) format Date if (date == null) { return null; SimpleDateFormat sdf = new SimpleDateFormat(outputPattern); return sdf.format(date); |
String | formatDate(Date date, String pattern) format Date LOCK.lock(); try { DateFormat fmt = new SimpleDateFormat(pattern); return fmt.format(date); } catch (Exception e) { e.printStackTrace(); return null; } finally { ... |
String | formatDate(Date date, String pattern) format date with the given pattern. SimpleDateFormat format = new SimpleDateFormat(pattern); return format.format(date); |
String | formatDate(Date date, String pattern) format Date SimpleDateFormat format = new SimpleDateFormat(pattern); return format.format(date); |
String | formatDate(Date date, String pattern) format Date if (pattern == null || pattern.equals("") || pattern.equals("null")) { pattern = "yyyy-MM-dd"; SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(date); |
String | FormatDate(Date date, String sf) Format Date if (date == null) return ""; SimpleDateFormat dateformat = new SimpleDateFormat(sf); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); if (date.getHours() == 0) return sdf.format(date); else return dateformat.format(date); ... |
String | formatDate(Date date, TimeZone timeZone) format Date return TIMEZONE_DATE_FORMATS.get().computeIfAbsent(timeZone, aTimeZone -> { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); sdf.setTimeZone(aTimeZone); return sdf; }).format(date); |
String | formatDate(Date inputDate, String formatPattern) Formats the date as specified in the target pattern. String returnValue = null; if ((inputDate != null) && (formatPattern != null)) { SimpleDateFormat targetFormat = new SimpleDateFormat(formatPattern); returnValue = targetFormat.format(inputDate); return returnValue; |
String | formatDate(Date unformattedDate, String format) Formats a give date with the supplied format String formattedDate = ""; try { DateFormat df = DateFormat.getInstance(); SimpleDateFormat sf = (SimpleDateFormat) df; sf.applyPattern(format); formattedDate = df.format(unformattedDate); } catch (RuntimeException e) { return formattedDate; |
String | formatDate(DateTime aDateTime) format Date if (aDateTime == null) { return null; SimpleDateFormat theFormat = new SimpleDateFormat(XML_DATE_FORMAT); theFormat.setTimeZone(Calendar.getInstance().getTimeZone()); return theFormat.format(aDateTime.toDate()); |