List of utility methods to do Parse Date
long | parseDate(String dateString, String pattern) Parse a date time String according to a supplied pattern. return new SimpleDateFormat(pattern).parse(dateString).getTime(); |
Date | parseDate(String dateText) parse Date return parseDate(dateText, null);
|
Date | parseDate(String datetime) parse Date try { return DATE_FORMAT.parse(datetime); } catch (ParseException e) { return new Date(); |
Date | parseDate(String dateVal) Parse string to date with default pattern yyyy-MM-dd return parseDate(dateVal, "yyyy-MM-dd"); |
Date | parseDate(String dateValue) Parse a string and return a date value return parseDate(C_DATE_PATTON_DEFAULT, dateValue);
|
Date | parseDate(String dateValue) Loops over all the possible date formats and tries to find the right one. if (dateValue == null) return null; Date date = null; for (int i = 0; (date == null) && (i < formats.length); i++) { try { synchronized (formats[i]) { date = formats[i].parse(dateValue); } catch (ParseException e) { return date; |
Date | parseDate(String dateValue, String strFormat) parse Date if (dateValue == null) return null; if (strFormat == null) strFormat = "yyyy-MM-dd"; SimpleDateFormat dateFormat = new SimpleDateFormat(strFormat); Date newDate = null; try { newDate = dateFormat.parse(dateValue); ... |
Date | parseDate(String dttm) _more_ if (dateFormats == null) { String[] formats = { "yyyy-MM-dd'T'HH:mm:ss", "yyyy-MM-dd HH:mm:ss z", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM-dd", "yyyyMMddHHmmss", "yyyyMMddHHmm", "yyyyMMddHH", "yyyyMMdd" }; dateFormats = new ArrayList<SimpleDateFormat>(); for (int i = 0; i < formats.length; i++) { SimpleDateFormat dateFormat = new java.text.SimpleDateFormat(formats[i]); dateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT")); dateFormats.add(dateFormat); ... |
Date | parseDate(String dttm) Parse the date. String[] formats = { "yyyy-MM-dd HH:mm:ss z", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM-dd", "yyyyMMddHHmmss", "yyyyMMddHHmm", "yyyyMMddHH", "yyyyMMdd" }; for (int i = 0; i < formats.length; i++) { SimpleDateFormat dateFormat = new java.text.SimpleDateFormat(formats[i]); dateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT")); Date date = dateFormat.parse(dttm, new ParsePosition(0)); if (date != null) { return date; ... |
Date | parseDate(String format, String value) parse Date SimpleDateFormat df = getDateFormat(format);
return df.parse(value);
|