public class InstantFormatter extends java.lang.Object implements Formatter<java.time.Instant>
Formatter
implementation for a JSR-310 Instant
,
following JSR-310's parsing rules for an Instant (that is, not using a
configurable 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.Instant.parse(java.lang.CharSequence)
,
DateTimeFormatter.ISO_INSTANT
,
DateTimeFormatter.RFC_1123_DATE_TIME
Constructor and Description |
---|
InstantFormatter() |
Modifier and Type | Method and Description |
---|---|
java.time.Instant |
parse(java.lang.String text,
java.util.Locale locale)
Parse a text String to produce a T.
|
java.lang.String |
print(java.time.Instant object,
java.util.Locale locale)
Print the object of type T for display.
|
public java.time.Instant parse(java.lang.String text, java.util.Locale locale) throws java.text.ParseException
Parser
public java.lang.String print(java.time.Instant object, java.util.Locale locale)
Printer