FormatStyle

  • FormatStyle is an enumeration used to define the style of localized date, time, or date-time formatters.

  • It is used for configuring the output style of date-time formatters like DateTimeFormatter and DateTimeFormatterBuilder.

  • The available styles include FULL, LONG, MEDIUM, and SHORT, each providing a different level of detail in the formatted output.

  • These styles range from full text representations with maximum detail to short, typically numeric formats.

public final enum FormatStyle extends Enum<FormatStyle>

Enumeration of the style of a localized date, time or date-time formatter.

These styles are used when obtaining a date-time style from configuration. See DateTimeFormatter and DateTimeFormatterBuilder for usage.

Inherited Method Summary

Enum Values

public static final FormatStyle FULL

Full text style, with the most detail. For example, the format might be 'Tuesday, April 12, 1952 AD' or '3:30:42pm PST'.

public static final FormatStyle LONG

Long text style, with lots of detail. For example, the format might be 'January 12, 1952'.

public static final FormatStyle MEDIUM

Medium text style, with some detail. For example, the format might be 'Jan 12, 1952'.

public static final FormatStyle SHORT

Short text style, typically numeric. For example, the format might be '12.13.52' or '3:30pm'.