嘿大家我试图从一个看起来像DateTime
的字符串中解析"20110406080000.000[-4:EDT]"
并遇到问题[-4:EDT]
DateTimeFormat.forPattern("yyyyMMddHHmmss.SSS[ZZ]").parseDateTime("20110406080000.000[-4:EDT]")
会导致以下错误
java.lang.IllegalArgumentException: Invalid format: "20110406080000.000[-4:EDT]" is malformed at "-4:EDT]"
at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:673)
at .<init>(<console>:8)
at .<clinit>(<console>)
at RequestResult$.<init>(<console>:9)
at RequestResult$.<clinit>(<console>)
at RequestResult$scala_repl_result(<console>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at scala.tools.nsc.Interpreter$Request$$anonfun$loadAndRun$1$$anonfun$apply$17.apply(Interpreter.scala:988)
at scala.tools.nsc.Interpreter$...
任何建议都将不胜感激。
答案 0 :(得分:1)
你需要