不应该String
使用特定格式DateTimeFormatter
来解析LocalDateTime.parse()
吗?
测试
DateTimeFormatter formatter = ISODateTimeFormat.dateTimeNoMillis()
LocalDateTime ldt = new LocalDateTime()
String val = ldt.toString(formatter)
System.out.println(val) //2013-03-26T13:10:46
// parse() throws java.lang.IllegalArgumentException: Invalid format: "2013-03-26T13:10:46" is too short
LocalDateTime nldt = LocalDateTime.parse(val, formatter)