List of utility methods to do Parse Date Pattern YYYY
long | parse(String string) parse return parse(string, ISO_DATETIME_FORMAT);
|
Date | parse(String string) Convert a string to date format if (string == null) return null; string = string.trim(); if (string.equals("unknown") || string.equals("")) return null; try { if (!"".equals(string)) { SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); ... |
Date | parse(String stringData) parse final DateFormat fmt; if (stringData.endsWith("Z")) { fmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); } else { fmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); try { return fmt.parse(stringData); ... |
Date | parse(String text) This method tries several different formats to parsing a date. for (String formatString : formatStrings) { try { return new SimpleDateFormat(formatString).parse(text); } catch (ParseException e) { return null; |
Calendar | parse(String text) Parses a ISO8601-compliant date/time string. String tzID = "GMT"; int tzPos = text.indexOf('Z'); if (tzPos == -1) { tzPos = text.indexOf('+'); if (tzPos == -1) { tzPos = text.indexOf('-', 8); if (tzPos == -1) { ... |
Date | parse(String time) parse if (time == null || time.isEmpty()) return null; try { return dayTime.parse(time); } catch (Exception ex) { try { return day.parse(time); ... |
Date | parse(String time, String df) Parse to GMT date return parse(time, df, null);
|
Date | parse1(String DateString, String dateTimeSeparator) Attempts to parse a date string with various formats including "- ,/, and ." Date Result; SimpleDateFormat fmt = new SimpleDateFormat(); fmt.setLenient(true); String Date_formats[] = { "yyyy", "yyyy-MM", "yyyy-MM-dd", "yyyy.MM.dd", "yy-MMM-dd", "yyyy-M-d", "yyyy.M.d", "yy.MM.dd", "yy.N.d", "MM/dd/yyyy", "MM/dd/yy", "M/d/yyyy", "M/d/yy", "MMM/dd/yyyy", "MMM/d/yyyy", "MMM/dd/yy", "MMM/d/yy", "MMM dd/yyyy", "MMM d/yyyy", "MMM dd/yy", "MMM d/yy", "dd-MMM-yyyy", "dd/MMM/yyyy", "dd-MMM-yy", "d/MMM/yy", "MMM dd,yy" }; String Time_formats[] = { "HH:mm:ss", "HH:mm", "hh:mm a", "hh:mma", "H:mm:ss", "H:mm", "h:mm a", "h:mma", ... |
String | parse2DateString(String date) parse Date String DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date d = null; try { d = df.parse(date); } catch (ParseException e) { e.printStackTrace(); return df.format(d); ... |
Object | parse_default(String time) parsdefault try { return FORMATER_3.parseObject(time); } catch (ParseException e) { e.printStackTrace(); return null; |