List of utility methods to do Date to String
String | date2Str(Date aDate) date Str SimpleDateFormat df = null; String returnValue = ""; if (aDate != null) { df = new SimpleDateFormat("yyyy-MM-dd"); returnValue = df.format(aDate); return (returnValue); |
String | date2Str(Date date) date Str String format = "yyyy-MM-dd HH:mm:ss"; return date2Str(date, format); |
String | Date2Str(Date date) Date Str String str = null; try { str = new SimpleDateFormat("yyyy/MM/dd,HH:mm:ss").format(date); } catch (Exception e) { return str; |
String | date2Str(Date date) date Str try { return dateFormat.format(date); } catch (Exception ex) { return ""; |
String | date2Str(Date date, String dateFormat) date Str if (date == null) { return null; SimpleDateFormat df = new SimpleDateFormat(dateFormat); return df.format(date); |
String | date2Str(Date date, String format) date Str SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); |
String | date2Str(Date date, String format) convert a date to a format string default format:yyyy-MM-dd HH:mm:ss if (date != null) return long2Datestr(date.getTime(), format); else return long2Datestr(new Date().getTime(), format); |
String | date2Str(Date date, String partten) date Str String result = null;
df.applyPattern(partten);
result = df.format(date);
return result;
|
String | date2Str(Date date, String pattern) date Str if (null == date) { return null; if (null == pattern) { pattern = DEFAULT_DATE_FORMAT; SimpleDateFormat format = new SimpleDateFormat(); format.applyPattern(pattern); ... |
String | date2Str(Date value) date Str if (value == null) return null; return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value); |