code: public static Instant parseIso8601Date(String dateString) {
          // For EC2 Spot Fleet.
          if (dateString.endsWith("+0000")) {
              dateString = dateString
                      .substring(0, dateString.length() - 5)
                      .concat("Z");
          }
  
          try {
              return parseInstant(dateString, ISO_INSTANT);
          } catch (DateTimeParseException e) {
              return parseInstant(dateString, ALTERNATE_ISO_8601_DATE_FORMAT);
          }
      }
docs: Parses the specified date string as an ISO 8601 date (yyyy-MM-dd'T'HH:mm:ss.SSSZZ)
  and returns the {@link Instant} object.
  
  @param dateString
  The date string to parse.
  
  @return The parsed Instant object.