List of utility methods to do String to Date
DateFormat | toDateFormat(Integer grain, TimeZone timeZone, String dateFormatArg) to Date Format if (dateFormatArg != null) { DateFormat result = new SimpleDateFormat(dateFormatArg); if (timeZone != null) { result.setTimeZone(timeZone); return result; } else { return dateFormat(grain, timeZone); ... |
Date | toDateFormat(String date) Formats an xsd:dateTime to a JAVA object data SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSS'Z'"); return sdf.parse(date); |
DateFormat | toDateFormat(String dateFormat, TimeZone tz, Locale locale) Returns an initialized DateFormat object. DateFormat df = null; if (dateFormat == null) { df = DateFormat.getDateInstance(DateFormat.SHORT, locale); } else { df = new SimpleDateFormat(dateFormat); df.setTimeZone(tz); return df; ... |
String | toDateOracle(Date d, String format, String hqlFormat) to Date Oracle StringBuffer bf = new StringBuffer(); bf.append("to_date('"); bf.append(dateFormat(d, format)); bf.append("','"); bf.append(hqlFormat); bf.append("')"); return bf.toString(); |
Date[] | toDates(DateFormat format, String[] values) to Dates return toDates(format, values, null);
|
String | toDateString(Calendar cal) to Date String if (cal != null) { return ibmDateFormat.format(cal.getTime()); return null; |
String | toDateString(Date date) to Date String if (date == null) { return ""; return new SimpleDateFormat(Format_Date).format(date); |
String | toDateString(Date date) to Date String SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+8")); return dateFormat.format(date); |
String | toDateString(Date date) to Date String return new SimpleDateFormat("yyyy-MM-dd HH:mm").format(date); |
String | toDateString(Date date, String format) to Date String SimpleDateFormat dateFormat = new SimpleDateFormat(format); return dateFormat.format(date); |