maybe要 2021-08-23 14:09 采纳率: 100%
浏览 126
已结题

java.time.DateTimeException: Unable to extract ZoneId from temporal

 DateTimeFormatter dtf4 = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG);     
LocalDateTime ldt1=LocalDateTime.now();
System.out.println(dtf4.format(ldt1));

情况就是在第一行代码中当我输入FormatStyle.LONG时就会报java.time.DateTimeException: Unable to extract ZoneId from temporal
但是我输入FormatStyle.MEDIUM或者FormatStyle.SHORT就正常输出
请问这是什么情况呢?感谢知到其中原因的朋友讲解一下

  • 写回答

1条回答 默认 最新

编辑
预览

报告相同问题?

问题事件

  • 系统已结题 8月30日
  • 已采纳回答 8月23日
  • 创建了问题 8月23日