我收到此错误 格式无效:“09:30 PM”在“PM”时格式错误
LocalTime start = new LocalTime();
LocalTime end = new LocalTime();
DateTimeFormatter formatter = DateTimeFormat.forPattern("hh:mm a");
start = formatter.parseLocalTime(from.toLowerCase());
end = formatter.parseLocalTime(to.toLowerCase());
最佳答案
您的模式不正确。请使用以下内容:
DateTimeFormatter formatter= DateTimeFormat.forPattern("hh:mm aa");
编辑:这是指向 Documentation for DateTimeFormat 的链接.
关于android - 使用 Joda 时间将 12 小时时间转换为 24 小时时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42131886/