List of utility methods to do Parse Date
String | parseDate(Date date, String format) parse Date SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); |
String | parseDate(Date date, String pattern) parse Date if (date == null) { return null; try { SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(date); } catch (Exception ex) { ex.printStackTrace(); ... |
Date | parseDate(DateFormat df, String dateStr) parse date as ET or UTC Date date = null; if (dateStr != null && dateStr.length() > 0) { try { if (dateStr.contains("UTC")) { date = df.parse(dateStr); } else if (dateStr.contains("ET")) { date = df.parse(dateStr.replace("ET", "EST")); if (ET.inDaylightTime(date)) { ... |
Date | parseDate(DateFormat f, String date) Parse date with formatter. try { return f.parse(date); } catch (ParseException e) { throw new RuntimeException(e); |
String | parseDate(final Date date) parse Date String dateStr = null; if (date != null) { final DateFormat time = DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.ENGLISH); final DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.ENGLISH); dateStr = time.format(date) + ", " + df.format(date); return dateStr; |
Date | parseDate(final String date) parse Date return DATE_FORMAT.parse(date);
|
Date | parseDate(final String date) parse Date return dateFormat.parse(date);
|
long | parseDate(final String date) Parses a string in the format yyyy-MM-ddTHH:mm:ssZ into a long timestamp. return DATE_FORMAT.get().parse(date).getTime() / 1000;
|
Date | parseDate(final String date) parse Date if (date.startsWith("PT")) { return parseDuration(date); final SimpleDateFormat dateFormat = new SimpleDateFormat(); dateFormat.setLenient(false); for (int i = 0; i < DATEFORMATS.length; i++) { try { final String dateformat = DATEFORMATS[i]; ... |
Date | parseDate(final String date, final List Tries to convert the given String to a Date. for (String pattern : patterns) { final SimpleDateFormat formatter = new SimpleDateFormat(pattern); try { final Date result = formatter.parse(date); return result; } catch (final ParseException e) { return null; |