Java Utililty Methods Parse Date Pattern YYYY

List of utility methods to do Parse Date Pattern YYYY

Description

The list of methods to do Parse Date Pattern YYYY are organized into topic(s).

Method

StringparseSegKeyDate4Display(String source)
yyyyMMdd -> dd/MM/yyyy
return sdf4Display.format(sdf4Key.parse(source));
ListparseSessionTime(String response)
parse Session Time
List<Date> res = new ArrayList<Date>();
int idx = response.indexOf("<div class=\"purple_box\">");
while (idx > 0) {
    int sDayIdx = response.indexOf(">", idx + 10) + 1;
    String day = response.substring(sDayIdx, response.indexOf("<", sDayIdx));
    SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy");
    Date utilDate = null;
    try {
...
DateparseSilently(String p_string)
parse Silently
try {
    SimpleDateFormat parser = new SimpleDateFormat("EEE MMM d HH:mm:ss zzz yyyy");
    return parser.parse(p_string);
} catch (Exception e) {
    return null;
DateparseSimpleDate(String string, Date defaultDate)
parse Simple Date
if (string == null) {
    return defaultDate;
try {
    return SIMPLE_DAY_FORMAT.parse(string);
} catch (ParseException e) {
    return defaultDate;
DateparseSipDateTime(String dateStr)
Parses the date and time from the given SIP2 formatted string.
SimpleDateFormat simpleDf = new SimpleDateFormat("yyyyMMdd    HHmmss");
try {
    return simpleDf.parse(dateStr);
} catch (ParseException pe) {
    return null;
DateparseSolrDate(String date)
parse Solr Date
DateFormat dateFormat = new SimpleDateFormat(SOLR_DATE_FORMAT);
dateFormat.setTimeZone(TIME_ZONE);
return dateFormat.parse(date);
DateparseSpaydDate(String date, TimeZone tz)
parse Spayd Date
if (date == null) {
    return null;
if (dateFormat == null) {
    dateFormat = new SimpleDateFormat("yyyyMMdd");
if (tz != null) {
    dateFormat.setTimeZone(tz);
...
DateparseString(String date)
Parses a Date to a string using #DATE_STORAGE_FORMAT .
if (date == null || date.isEmpty() || date.trim().equalsIgnoreCase("never")) {
    return null;
try {
    return new SimpleDateFormat(DATE_STORAGE_FORMAT, Locale.ENGLISH).parse(date);
} catch (ParseException ex) {
    return new Date(0L);
CalendarparseString(String dateStr)
parse String
return parseString(dateStr, DEFAULTFORMAT);
StringparseString(String strDate)
parse String
if (strDate == null || "".equals(strDate)) {
    return null;
if (strDate.length() > 19) {
    strDate = strDate.substring(0, 19);
Date bufferDate = parse(strDate, defaultDatePattern1);
return format(bufferDate);
...