List of utility methods to do SQL Date to String
String | date2str(java.util.Date date) datestr if (date == null) return ""; try { return MMddYYYY_HHmmss.format(date); } catch (Exception e) { return ""; |
String | date2String(final java.sql.Date value) Date to string return value.toString();
|
String | toString(Date date) to String if (date instanceof Timestamp) { return toString((Timestamp) date); } else { return Long.toString(date.getTime()); |
String | toString(Date date) to String if (date == null) { return ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return sdf.format(date); |
String | toString(Date date, String dateFormat) to String SimpleDateFormat formatter = new SimpleDateFormat(dateFormat); return formatter.format(date); |
String | toString(Date date, String format) to String return toString((java.util.Date) date, format);
|
String | toString(Date obj) to String if (obj == null) { return ""; DateFormat dftime = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String str = dftime.format(obj); if (str.indexOf("00:00:00") < 0) { return str; } else { ... |
String | toString(java.sql.Date sqlDate, String format) converts a java.sql.Date string with appropriate format if (DISPLAY_DATE_FORMAT.equalsIgnoreCase(format)) { Calendar calendar = Calendar.getInstance(); calendar.setTime(sqlDate); return getDateAsString(calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.DATE), calendar.get(Calendar.YEAR)); else if (DISPLAY_DATE_TIME_FORMAT.equals(format)) { Calendar calendar = Calendar.getInstance(); ... |
String | toString(Object date) Convert an Object to a String using Dates if (date == null) { return null; if (java.sql.Timestamp.class.isAssignableFrom(date.getClass())) { return OUT_TIMESTAMP_FORMAT.format(date); if (java.sql.Time.class.isAssignableFrom(date.getClass())) { return OUT_TIME_FORMAT.format(date); ... |
String | toString(Object object) to String if (object == null) { return ""; } else if (object instanceof Date) { return df.format(object); } else if (object instanceof Timestamp) { return df.format(object); } else return object.toString(); ... |