【发布时间】:2016-12-18 22:59:00
【问题描述】:
我在将 Oracle (11.2.0.4.0) TIMESTAMP(6) WITH TIME ZONE 值解析为 OffsetDateTime 时遇到问题:
java.time.format.DateTimeParseException: Text '2014-03-28T15:11:49.508918 -4:00' could not be parsed at index 26
java.time.format.DateTimeFormatter.parseResolved0(Unknown Source)
java.time.format.DateTimeFormatter.parse(Unknown Source)
java.time.OffsetDateTime.parse(Unknown Source)
java.time.OffsetDateTime.parse(Unknown Source)
org.jooq.impl.DefaultBinding.offsetDateTime(DefaultBinding.java:1539)
我认为这是这里描述的问题:https://github.com/jOOQ/jOOQ/issues/4965
Oracle (2014-03-28T15:11:49.508918 -4:00) 产生的 not-quite-iso8601 值实际上有两个问题被OffsetDateTime.parse 拒绝:
- 个位数小时(根据 #4965)
- 偏移前的空格
是否有解决方法,直到修复到达(在 3.9 中)?
【问题讨论】: