org.springframework.format.datetime

## Class DateFormatterRegistrar

- java.lang.Object
- - org.springframework.format.datetime.DateFormatterRegistrar

All Implemented Interfaces:
  FormatterRegistrar

    public class DateFormatterRegistrar
    extends Object
    implements FormatterRegistrar

Configures Date formatting for use with Spring.

Designed for direct instantiation but also exposes the static `addDateConverters(ConverterRegistry)` utility method for ad hoc use against any `ConverterRegistry` instance.

Since:
  3.2
Author:
  Phillip Webb
See Also:
  `JodaTimeFormatterRegistrar`, `FormatterRegistrar.registerFormatters(org.springframework.format.FormatterRegistry)`

### Constructor Summary

Constructors
Constructor and Description
`DateFormatterRegistrar()`

### Method Summary

Methods
`static void` `addDateConverters(ConverterRegistry converterRegistry)` Add date converters to the specified registry.
`void` `registerFormatters(FormatterRegistry registry)` Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.
`void` `setFormatter(DateFormatter dateFormatter)` Set the date formatter to register.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DateFormatterRegistrar

    public DateFormatterRegistrar()

### Method Detail

#### registerFormatters

    public void registerFormatters(FormatterRegistry registry)

Description copied from interface: `FormatterRegistrar`
Register Formatters and Converters with a FormattingConversionService through a FormatterRegistry SPI.

Specified by:
  `registerFormatters` in interface `FormatterRegistrar`
Parameters:
  `registry` - the FormatterRegistry instance to use.

#### setFormatter

    public void setFormatter(DateFormatter dateFormatter)

Set the date formatter to register. If not specified the default `DateFormatter` will be used. This method can be used if additional formatter configuration is required.

Parameters:
  `dateFormatter` - the date formatter

#### addDateConverters

    public static void addDateConverters(ConverterRegistry converterRegistry)

Add date converters to the specified registry.

Parameters:
  `converterRegistry` - the registry of converters to add to