spring-framework / org.springframework.format.datetime.standard / InstantFormatter

InstantFormatter

open class InstantFormatter : Formatter<Instant>

Formatter implementation for a JSR-310 java.time.Instant, following JSR-310's parsing rules for an Instant (that is, not using a configurable java.time.format.DateTimeFormatter): accepting the default ISO_INSTANT format as well as RFC_1123_DATE_TIME (which is commonly used for HTTP date header values), as of Spring 4.3.

Author
Juergen Hoeller

Since
4.0

See Also
java.time.Instant#parsejava.time.format.DateTimeFormatter#ISO_INSTANTjava.time.format.DateTimeFormatter#RFC_1123_DATE_TIME

Constructors

<init>

InstantFormatter()

Formatter implementation for a JSR-310 java.time.Instant, following JSR-310's parsing rules for an Instant (that is, not using a configurable java.time.format.DateTimeFormatter): accepting the default ISO_INSTANT format as well as RFC_1123_DATE_TIME (which is commonly used for HTTP date header values), as of Spring 4.3.

Functions

parse

open fun parse(text: String, locale: Locale): Instant

print

open fun print(object: Instant, locale: Locale): String