@UsesJava8 public class InstantFormatter extends Object implements Formatter<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 |
---|---|
Instant |
parse(String text,
Locale locale)
Parse a text String to produce a T.
|
String |
print(Instant object,
Locale locale)
Print the object of type T for display.
|
public Instant parse(String text, Locale locale) throws ParseException
Parser
parse
in interface Parser<Instant>
text
- the text stringlocale
- the current user localeParseException
- when a parse exception occurs in a java.text parsing library