我执行下面的代码,给了我运行时异常,同时试图使用乔达DateTimeFormatter
"Exception in thread "main" org.joda.time.IllegalFieldValueException: Cannot parse "12/17/2017 23:10": Value 23 for clockhourOfHalfday must be in the range [1,12]"
DateTimeFormatter dt = DateTimeFormat.forPattern("MM/dd/yyyy hh:mm");
System.out.println(dt.parseDateTime("12/17/2017 23:10"));
如果我将解析"12/17/2017 02:10"
解析日期时间然后成功执行。
所以基本上,我需要解析具有24小时时钟格式的时间。
在此先感谢。
它正在工作。谢谢:) – Rahul
(这也是SimpleDateFormat中的12小时时钟...) –