5
parseLocalDate的API说它会抛出UnsupportedOperationException
“如果解析不被支持”。 '如果解析不被支持'意味着什么?我正在查看源代码,找不到任何引发UnsupportedOperationException
的问题。有没有人遇到过这种例外情况:parseLocalDate
?DateTimeFormatter.parseLocalDate抛出UnsupportedOperationException
阿好知道了,谢谢。看起来好像'org.joda.time.format.DateTimeFormat.forPattern(String)'将总是返回一个带打印机和解析器的'DateTimeFormatter';所以通过'forPattern'获取的'DateTimeFormatter'不应该抛出UnsupportedOperationException正确吗? – FGreg 2013-05-03 13:22:16
@FGreg是的,这是真的 – Ilya 2013-05-03 13:27:14
此外,请注意有两个类似的实例方法:'ISODateTimeFormat.dateTime()'和'ISODateTimeFormat.dateTimeParser()'。如果你使用后者并尝试'.format(dateTime)',你会得到这个异常。 – membersound 2015-02-06 14:37:09