List of utility methods to do Date to String
String | dateToString(Date date) Convert Date to String with MM/dd/yyyy format. SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); return sdf.format(date); |
String | dateToString(Date date) date To String if (date == null) { return "NULL"; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS'Z'", Locale.getDefault()); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); String formatted = dateFormat.format(date); return formatted; |
String | dateToString(Date date) date To String String dateString = null; if (date != null) { SimpleDateFormat sdf = new SimpleDateFormat(m_datePattern); sdf.setTimeZone(TimeZone.getTimeZone("Europe/Berlin")); dateString = sdf.format(date); return dateString; |
String | dateToString(Date date) Converts Date type to String based on RFC3339 formatting final TimeZone utc = TimeZone.getTimeZone("UTC"); SimpleDateFormat tformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); tformat.setTimeZone(utc); return tformat.format(date); |
String | dateToString(Date date) Converts the date to String if (date == null) { return null; return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date); |
String | DateToString(Date date) Convert date to string , default pattern is yyyy-MM-dd return DateToString(date, DATE_PATTERN);
|
String | dateToString(Date date) date To String DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); Date today = Calendar.getInstance().getTime(); String reportDate = df.format(today); return reportDate; |
String | dateToString(Date date) date To String if (date == null) return ""; else { SimpleDateFormat sdFormat = new SimpleDateFormat(DEFAULT_DATE_FORMATE, Locale.getDefault()); String str_Date = sdFormat.format(date); return str_Date; |
String | dateToString(Date date) date To String if (date == null) return ""; return FormatDate(date, "yyyy-MM-dd HH:mm:ss"); |
String | dateToString(Date date, String dateFormat) date To String if (date == null) return ""; try { return new SimpleDateFormat(dateFormat).format(date); } catch (Exception e) { e.printStackTrace(); return ""; |