无法从 TemporalAccessor 获取 OffsetDateTime
当我这样做时
String datum = "20130419233512";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss").withZone(ZoneId.of("Europe/Berlin"));
OffsetDateTime datetime = OffsetDateTime.parse(datum, formatter);
我得到以下异常:
java.time.format.DateTimeParseException: Text '20130419233512' could not be parsed:
Unable to obtain OffsetDateTime from TemporalAccessor: {InstantSeconds=1366407312},ISO,Europe/Berlin resolved
to 2013-04-19T23:35:12 of type java.time.format.Parsed
如何解析我的日期时间字符串,以便将其解释为始终来自时区“欧洲/柏林”?