类 InstantFormatter
- java.lang.Object
- org.springframework.format.datetime.standard.InstantFormatter
@UsesJava8 public class InstantFormatter extends Object implements Formatter<Instant>
Formatter
implementation for a JSR-310Instant
, following JSR-310's parsing rules for an Instant (that is, not using a configurableDateTimeFormatter
): accepting the defaultISO_INSTANT
format as well asRFC_1123_DATE_TIME
(which is commonly used for HTTP date header values), as of Spring 4.3.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
Instant.parse(java.lang.CharSequence)
,DateTimeFormatter.ISO_INSTANT
,DateTimeFormatter.RFC_1123_DATE_TIME
构造器概要
构造器 构造器 说明 InstantFormatter()
构造器详细资料
InstantFormatter
public InstantFormatter()
方法详细资料
parse
public Instant parse(String text, Locale locale) throws ParseException
从接口复制的说明:Parser
Parse a text String to produce a T.- 指定者:
parse
在接口中Parser<Instant>
- 参数:
text
- the text stringlocale
- the current user locale- 返回:
- an instance of T
- 抛出:
ParseException
- when a parse exception occurs in a java.text parsing library