List of utility methods to do Parse Date Pattern YYYY
Date | parseOpenMrsDate(String date) parse Open Mrs Date SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); return dateFormat.parse(date); |
Date | parsePurgeDateString(String str) parse Purge Date String if (str == null) { return null; SimpleDateFormat purgeDateFormat = new SimpleDateFormat(PURGE_DATE_FORMAT); return purgeDateFormat.parse(str); |
Date | parser(String strDate, String formatter) parser SimpleDateFormat sdf = new SimpleDateFormat(formatter); try { return sdf.parse(strDate); } catch (Exception e) { return null; |
Date | parserDate(String str) parser Date if (null == str) return null; return parserDate(str, format0); |
String | parseRegExcelNumber(String number) parse Reg Excel Number String today_d = formatToday("dd"), today_m = formatToday("MM"), today_y = formatToday("yyyy"); String regex = "(" + today_y.substring(0, 2) + ")?" + today_y.substring(2) + today_m + today_d; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(number); String buf = ""; if (m.find()) { if (m.group().length() == 6) { buf = (m.start() == 0 ? "" : "<NUMBER>") + "<DATE:TODAY:YYMMDD>" ... |
Date | parseResponseDate(String date) parse Response Date Date returnDate = null; for (int i = 0; i < DATETIME_FORMATS.length; ++i) { try { returnDate = DATETIME_FORMATS[i].parse(date); return returnDate; } catch (ParseException e) { return null; |
Date | parseRoundTripDateString(String roundTripString) Parses the given round-trip date string (e.g. SimpleDateFormat roundTripDateFormat = new SimpleDateFormat(ROUND_TRIP_DATE_FORMAT); Date date = roundTripDateFormat.parse(roundTripString); return date; |
Date | parseRSSDate(String dateStr) parse RSS Date for (String format : RSS_DATE_FORMATS) { DateFormat formatter = new SimpleDateFormat(format, Locale.ROOT); try { Date date = formatter.parse(dateStr); return date; } catch (Exception e) { return null; |
Date | parseSalesDate(final String ymd) parse Sales Date if (ymd == null || ymd.isEmpty()) { return null; final DateFormat dateFormat = new SimpleDateFormat(H_DATE_FROMAT); Date tmp; try { tmp = dateFormat.parse(ymd); } catch (ParseException e) { ... |
Date | parseSecureDate(final String dateString) Parses the given string date-time. try { final Date date = SDF.parse(dateString); return date; } catch (ParseException e) { return null; |