List of utility methods to do Date Format
String | convertDateToString(Date date, String format) convert Date To String SimpleDateFormat df = new SimpleDateFormat(format); return df.format(date); |
String | convertDateToString(Date date, String pattern) convert Date To String SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(date); |
String | convertDateToString(Date date, String pattern) convert Date To String SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); if (date == null) { return ""; try { return dateFormat.format(date); } catch (Exception e) { e.printStackTrace(); ... |
String | convertDateToString(Date date, String patternString, Locale locale) convert Date To String SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patternString, locale); return simpleDateFormat.format(date); |
String | convertDateToString(Date dateObject, String dateFormat) Method to convert the Date to String, Format of date to be specified. if (dateObject == null || isStringBlank(dateFormat)) { return null; SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat); StringBuilder nowYYYYMMDD = new StringBuilder(dateFormatter.format(dateObject)); return nowYYYYMMDD.toString(); |
String | convertDateToStringByFormat(Date date) convert Date To String By Format SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return sdf.format(date); |
String | convertDateToStringT(final Date date) convert Date To String T String dateString = null; dateString = date == null ? "" : new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date); return dateString; |
String | convertDateToStringUI(Date data) convert Date To String UI if (data == null) return null; String date = null; try { DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); date = formatter.format(data); } catch (Exception e) { System.err.println(e.getMessage()); ... |
String | convertDateToText(Date date) Convert custom field value to text form if (date != null) { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); return formatter.format(date); return null; |
String | convertDateToUTC(Date date) Converts the given date to the UTC time zone so that dates can be correctly converted on the client side SimpleDateFormat dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return dateFormat.format(date); |