我搜索一个看起来像这样的模式:Thu, 11. 05. 1999
所以我试过这个语法:
String pattern = "DDD, dd. mm. uuuu";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
但它不会起作用。当我试图格式化LocalDate
时,我得到了java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: MinuteOfHour
。
查看Java的official documentation解释格式模式语法总是很好:
所以你应该尝试这种模式:
EEE, dd. MM. uuuu
将语言环境明确设置为英语也是一个好主意。