Joda-Time 的 DateTimeFormat 问题

在开发过程中遇到的问题是,当我使用,如下的代码时,会报异常 :"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"));

解决方法是将 hh 改为 HH ; 哈哈哈(代码不是我写的,我只是遇到了相同的问题,无耻的将别人的代码copy了一份,,很久以前遇到的问题了,最近才有时间总结,原文在哪儿我已经记不得了,,sorry...)

原文地址:https://www.cnblogs.com/lwmp/p/7681451.html