java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: ClockHourOfAmPm
今天在学设计模式,发现这个报错,百度一下,发现没有。记一下。
我的问题是因为我用
LocalDate.now()//生成了日期对象,我却用有时间的格式话对象去处理,所以会报这个错。
LocalDate.now().format(pattern_)
DateTimeFormatter pattern_ = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
![](https://img2020.cnblogs.com/blog/1424271/202105/1424271-20210523103437032-187626314.png)
加油,愿被这世界温柔以待 ^_^