Interface DateFormatter


public interface DateFormatter
Allows the formatting of a date according to predefined formats.
See Also:
  • Field Details

  • Method Details

    • formatDate

      @Nonnull String formatDate(@Nonnull Date date, @Nonnull DateFormatter.FormatType type)
      Format the passed date.
      Parameters:
      date - the date to format.
      type - the type of date rendering to generate.
      Returns:
      the formatted date.
    • formatInstant

      @Nonnull String formatInstant(@Nonnull Instant instant, @Nonnull DateFormatter.FormatType type)
      Format the passed Instant.
      Parameters:
      instant - the instant to render.
      type - the type of date rendering to generate.
      Returns:
      the formatted instant.
      Throws:
      NullPointerException - if any of the arguments is null.
      Since:
      4.5
    • getFormatString

      @Nullable String getFormatString(@Nullable String key)