private LocalDateTime parseDate(String dateStr,boolean tryAgain){
  LocalDateTime date=LocalDateTime.now(ZoneId.of("GMT"));
  if (mDateTimeFormatter == null) {
    initFormatter(dateStr);
  }
  if (mDateTimeFormatter != null) {
    try {
      date=LocalDateTime.parse(dateStr,mDateTimeFormatter);
    }
 catch (    DateTimeParseException e) {
      Timber.d(String.format("ParseException parsing date: %s",dateStr));
      if (tryAgain) {
        Timber.d("ParseException encountered, re-initializing the date parser");
        mDateTimeFormatter=null;
        parseDate(dateStr,false);
      }
    }
  }
  return date;
}

private LocalDateTime parseDate ( String dateStr , boolean tryAgain ) { LocalDateTime date = LocalDateTime . now ( ZoneId . of ( "GMT" ) ) ; if ( mDateTimeFormatter == null ) { initFormatter ( dateStr ) ; } if ( mDateTimeFormatter != null ) { try { date = LocalDateTime . parse ( dateStr , mDateTimeFormatter ) ; } catch ( DateTimeParseException e ) { Timber . d ( String . format ( "ParseException parsing date: %s" , dateStr ) ) ; if ( tryAgain ) { Timber . d ( "ParseException encountered, re-initializing the date parser" ) ; mDateTimeFormatter = null ; parseDate ( dateStr , false ) ; } } } return date ; }
parses a string date into a java date object
