@Deprecated
    public static String formatDate(final Date date, final String pattern) {
        Args.notNull(date, "Date");
        Args.notNull(pattern, "Pattern");
        return DateTimeFormatter.ofPattern(pattern).format(toInstant(date).atZone(GMT_ID));
    }
Formats the given date according to the specified pattern.

@param date The date to format.
@param pattern The pattern to use for formatting the date.
@return A formatted date string.

@throws IllegalArgumentException If the given date pattern is invalid.

@deprecated Use {@link #formatDate(Instant, DateTimeFormatter)}
httpclient5/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java