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