我知道我可以使用以下方法将 Spring MVC 表单 bean 绑定到 LocalDateTime:
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private LocalDateTime startTime;
这会将 String like 转换2016-01-11T15:05:05.123Z
为LocalDateTime
对象。
我在这里找到了一些文档:http: //blog.codeleak.pl/2014/06/spring-4-datetimeformat-with-java-8.html
我找不到如何对java.time.Duration
. 我该怎么做呢?