List of utility methods to do Parse Date Pattern YYYY
Calendar | parseEuropeanDateAnd12HrsTimeString(String aDateString, String aTimeString) parse European Date And Hrs Time String String tempStringToParse; if (aDateString != null) { tempStringToParse = aDateString; } else { tempStringToParse = "01.01.1970"; tempStringToParse += "T"; if (aTimeString.length() < 8) { ... |
Date | parseEXIFFormat(String dateString) parse EXIF Format String datePatterns[] = { "yyyy:MM:dd HH:mm:ss", "yyyy:MM:dd HH:mm", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm" }; for (String datePattern : datePatterns) { try { DateFormat parser = new SimpleDateFormat(datePattern); return parser.parse(dateString); } catch (ParseException ex) { return null; |
Date | parseExpireField(String timestring) parse Expire Field SimpleDateFormat[] sdfs = SIMPLE_DATE_FORMATS.get(); for (SimpleDateFormat sdf : sdfs) { Date date = sdf.parse(timestring, new ParsePosition(0)); if (date != null) return date; return null; |
Date | parseFormattedTime(String formattedTime) parse Formatted Time SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); return formatter.parse(formattedTime); |
Date | parseFTPDate(String dateStr) parse FTP Date return FTP_DATE_FORMAT.get().parse(dateStr);
|
Calendar | parseFullDate(String paramName, String dateStr) Tries to parse full formated date. Calendar day; try { day = Calendar.getInstance(); Date date = DATE_FORMAT.parse(dateStr); day.setTime(date); } catch (Exception e) { throw new IllegalArgumentException( "Unparsable \"" + paramName + "\". Must be in format " + DATE_FORMAT.toPattern(), e); ... |
Date | parseFullTime(String str) parse Full Time SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); return format.parse(str); |
Date | parseGeneralizedTimeAsDate(String generalizedTime) Parses a generalized time as a date ignoring hour minute seconds. if (generalizedTime != null) { return new SimpleDateFormat("yyyyMMdd").parse(generalizedTime.substring(0, 8)); return null; |
Date | parseHeaderDate(String headerValue) Get a header date value as Date if (headerValue != null && headerValue.length() >= 3) { for (String dateFormat : DATE_FORMATS) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat, Locale.US); simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); try { return simpleDateFormat.parse(headerValue); } catch (@SuppressWarnings("unused") ParseException ex) { return null; |
String | parseHHMMSS(long time) parse HHMMSS try { return FORMAT_HHMMSS.format(FORMAT_YYYYMMDDHHMMSSLong.parse(String.valueOf(time))); } catch (ParseException e) { e.printStackTrace(); return null; |