DateTimeFormatter

Methods
4
Fields
None

Getting one

DateTimeFormatter.ofPattern(…)
DateTimeFormatter.ofLocalizedTime(…)

Methods

MethodReturnsDescription
withZone(ZoneId)DateTimeFormatterThis formatter showing a value's instant in zone.
format(Instant | LocalTime | LocalDate | LocalDateTime | ZonedDateTime)stringtemporal formatted. A field the value does not have (yyyy of a LocalTime) is UnsupportedTemporalTypeException.
ofPattern(string)DateTimeFormatterA formatter for pattern; an invalid pattern is IllegalArgumentException.
ofLocalizedTime(FormatStyle)DateTimeFormatterThe localized time formatter in style, under the default (English, US) locale: h:mm:ss a for MEDIUM.

Returned by

MethodReturnsDescription
DateTimeFormatterClass.ofLocalizedTimeDateTimeFormatterThe localized time formatter in style, under the default (English, US) locale: h:mm:ss a for MEDIUM.
DateTimeFormatterClass.ofPatternDateTimeFormatterA formatter for pattern; an invalid pattern is IllegalArgumentException.

Method details