List of utility methods to do Date String Parse
Date | parseDA(String s, boolean end) parse DA if (s == null || s.length() == 0) return null; Calendar c = new GregorianCalendar(); c.clear(); if (end) { setToDec31(c); parseDA(c, s, 0, s.length()); ... |
Date | parseDT(String s, boolean end) parse DT if (s == null || s.length() == 0) { return null; Calendar c = new GregorianCalendar(); c.clear(); if (end) { setToDec31(c); setTo2359(c); ... |
Date | parseDate(String atomPubDate) parse Date return parseDate(atomPubDate, Locale.getDefault());
|
Date | parseDate(String atomPubDate, Locale locale) parse Date Date d = null; SimpleDateFormat sdf; for (int i = 0; i < DATE_FORMATS.length; i++) { sdf = new SimpleDateFormat(DATE_FORMATS[i], locale); sdf.setLenient(true); try { d = sdf.parse(atomPubDate); break; ... |
Date | parseDate(String date) parse Date if (date == null) return null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.parse(date); |
Date | parseDate(String date, SimpleDateFormat sdf) parse Date Date d = null; sdf.setLenient(true); try { d = sdf.parse(date); } catch (ParseException e) { d = parseDate(date); return d; ... |
Date | parseDate(String date, String format) parse Date if (date == null) { return null; return parseDate(date, new SimpleDateFormat(format, Locale.getDefault())); |
Date | parseDate(String date, String pattern) parse Date if (date == null) return null; SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.parse(date); |
Date | parseDate(String date, String pattern) Parses a date using a pattern describing the date and time format and the default TimeZone for this host. return parseDate(date, pattern, TimeZone.getDefault());
|
Date | parseDate(String date, String pattern, TimeZone zone) Parses a date using a pattern describing the date and time format. DateFormat dfmt = new SimpleDateFormat(pattern); dfmt.setTimeZone(zone); return dfmt.parse(date); |