DateStringConverter (JavaFX 28)
Description: declaration: module: javafx.base, package: javafx.util.converter, class: DateStringConverter

# Class DateStringConverter

java.lang.Object
javafx.util.StringConverter<Date>
javafx.util.converter.DateTimeStringConverter
javafx.util.converter.DateStringConverter

public class DateStringConverter extends DateTimeStringConverter

A `StringConverter` implementation for `Date` values that represent dates.

Note that using `Date` is not recommended in JDK versions where `LocalDate` is available, in which case `LocalDateStringConverter` should be used.

Since:
  JavaFX 2.1

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DateStringConverter()`
  Creates a `DateStringConverter` that uses a formatter/parser based on `DateFormat.DEFAULT` for the date style, and the user's `Locale`.
  `DateStringConverter(int dateStyle)`
  Creates a `DateStringConverter` that uses a formatter/parser based on the given date style, and the user's `Locale`.
  `DateStringConverter(String pattern)`
  Creates a `DateStringConverter` that uses a formatter/parser based on the given pattern, and the user's `Locale`.
  `DateStringConverter(DateFormat dateFormat)`
  Creates a `DateStringConverter` that uses the given formatter/parser.
  `DateStringConverter(Locale locale)`
  Creates a `DateStringConverter` that uses a formatter/parser based on `DateFormat.DEFAULT` for the date style, and the given `Locale`.
  `DateStringConverter(Locale locale, int dateStyle)`
  Creates a `DateStringConverter` that uses a formatter/parser based on the given date style and `Locale`.
  `DateStringConverter(Locale locale, String pattern)`
  Creates a `DateStringConverter` that uses a formatter/parser based on the given pattern and `Locale`.

- ## Method Summary

  ### Methods declared in class DateTimeStringConverter

  `fromString, toString`

  ### Methods declared in class Object

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

- ## Constructor Details

  - ### DateStringConverter

    public DateStringConverter()
    Creates a `DateStringConverter` that uses a formatter/parser based on `DateFormat.DEFAULT` for the date style, and the user's `Locale`.

  - ### DateStringConverter

    public DateStringConverter(int dateStyle)
    Creates a `DateStringConverter` that uses a formatter/parser based on the given date style, and the user's `Locale`.
    Parameters:
      `dateStyle` - the formatting style for dates. For example, `DateFormat.SHORT` for "M/d/yy" in the US locale.
    Since:
      JavaFX 8u40

  - ### DateStringConverter

    public DateStringConverter(Locale locale)
    Creates a `DateStringConverter` that uses a formatter/parser based on `DateFormat.DEFAULT` for the date style, and the given `Locale`.
    Parameters:
      `locale` - the `Locale` that will be used by the formatter/parser. If `null`, the user's locale will be used.

  - ### DateStringConverter

    public DateStringConverter(Locale locale, int dateStyle)
    Creates a `DateStringConverter` that uses a formatter/parser based on the given date style and `Locale`.
    Parameters:
      `locale` - the `Locale` that will be used by the formatter/parser. If `null`, the user's locale will be used.
      `dateStyle` - the formatting style for dates. For example, `DateFormat.SHORT` for "M/d/yy" in the US locale.
    Since:
      JavaFX 8u40

  - ### DateStringConverter

    public DateStringConverter(String pattern)
    Creates a `DateStringConverter` that uses a formatter/parser based on the given pattern, and the user's `Locale`.
    Parameters:
      `pattern` - the pattern describing the date format. If `null`, `DateFormat.DEFAULT` will be used for the date style.

  - ### DateStringConverter

    public DateStringConverter(Locale locale, String pattern)
    Creates a `DateStringConverter` that uses a formatter/parser based on the given pattern and `Locale`.
    Parameters:
      `locale` - the `Locale` that will be used by the formatter/parser. If `null`, the user's locale will be used.
      `pattern` - the pattern describing the date format. If `null`, `DateFormat.DEFAULT` will be used for the date style.

  - ### DateStringConverter

    public DateStringConverter(DateFormat dateFormat)
    Creates a `DateStringConverter` that uses the given formatter/parser.
    Parameters:
      `dateFormat` - the formatter/parser that will be used by the `toString()` and `fromString()` methods. If `null`, a default formatter/parser will be used.