public static @Nullable Date parseDate(@NotNull String s) {
    s = s.replace('/', '-');

    try {
      return Date.from(Instant.from(DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(s)));
    }
    catch (DateTimeParseException ignored) { }

    var matcher = ISO8601_DATE_PATTERN.matcher(s);
    if (matcher.matches()) {
      var date = matcher.group(1).replace('/', '-');
      var time = requireNonNullElse(matcher.group(2), "00:00:00");
      var millis = requireNonNullElse(matcher.group(3), ".000").substring(1);
      var timezone = requireNonNullElse(matcher.group(4), "Z");
      if (timezone.length() == 5) {
        // [+-]HHmm, missing colon
        timezone = timezone.substring(0, 3) + ':' + timezone.substring(3);
      }
      s = String.format("%sT%s.%s%s", date, time, millis, timezone);
      try {
        return Date.from(Instant.from(DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(s)));
      }
      catch (DateTimeParseException ignored) { }
    }

    return null;
  }
public static @Nullable Date parseDate(@NotNull String s)