List of utility methods to do Parse Date
String | parseDateString(String pattern, String dateString) parse Date String SimpleDateFormat df = new SimpleDateFormat(pattern); try { return df.format(df.parse(dateString)); } catch (java.text.ParseException e) { e.printStackTrace(); return null; |
Date | parseDateString(String s) Converts string to a date return parseDateString(s, "MM/dd/yy"); |
Date | parseDateString(TimeZone tz, String dateString) parse Date String return parseDateString(tz, dateString, "yyyy-MM-dd HH:mm:ss"); |
Date | parseDateStringToDate(DateFormat format, String dateString) parse Date String To Date if (format != null) { synchronized (format) { try { return format.parse(dateString); } catch (ParseException e) { return null; } else { return null; |
Date | parseDateStrShort(String date) parse Date Str Short return parse(date, DF_SHORT);
|
Date | parseDateSubset(String value, String[] parsePatterns, Locale l, TimeZone tz) parse Date Subset Date d = null; SimpleDateFormat parser = null; ParsePosition pos = new ParsePosition(0); for (int i = 0; i < parsePatterns.length; i++) { if (i == 0) { if (l == null) { parser = new SimpleDateFormat(parsePatterns[0]); } else { ... |
Date | parseDateTime(@Nullable String s) parse Date Time if (s == null) { return null; try { DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.parse(s); } catch (ParseException e) { ... |
Date | parseDateTime(final String dateTime) parse Date Time try { return dateTime == null ? null : dateTimeFormat.parse(dateTime); } catch (ParseException e) { throw new IllegalArgumentException("Could not construct date from: " + dateTime); |
Date | parseDateTime(String _date) parse Date Time synchronized (m_ISO8601Local) { return m_ISO8601Local.parse(_date.replaceFirst(":(\\d\\d)$", "$1")); |
Date | parseDateTime(String currDate, String format) parse Date Time SimpleDateFormat dtFormatdB = null; try { dtFormatdB = new SimpleDateFormat(format); return dtFormatdB.parse(currDate); } catch (Exception e) { dtFormatdB = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { return dtFormatdB.parse(currDate); ... |