public static @NotNull TagResolver date(@TagPattern final @NotNull String key, final @NotNull TemporalAccessor time) {
    return TagResolver.resolver(key, (argumentQueue, context) -> {
      final String format = argumentQueue.popOr("Format expected.").value();
      return Tag.inserting(context.deserialize(DateTimeFormatter.ofPattern(format).format(time)));
    });
  }
Creates a replacement that inserts a date or a time as a component. The component will be formatted by the provided Date Format.

<p>This tag expects a format as attribute. Refer to {@link DateTimeFormatter} for usable patterns.</p>

<p>This replacement is auto-closing, so its style will not influence the style of following components.</p>

@param key the key
@param time the time
@return the placeholder
@since 4.11.0
text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/resolver/Formatter.java