java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: ClockHourOfAmPm

 

 

今天在学设计模式,发现这个报错,百度一下,发现没有。记一下。

我的问题是因为我用

LocalDate.now()//生成了日期对象,我却用有时间的格式话对象去处理,所以会报这个错。
LocalDate.now().format(pattern_)
DateTimeFormatter pattern_ = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");

 

 

 


posted @ 2021-05-23 10:35  山河已无恙  阅读(1387)  评论(0编辑  收藏  举报