val dateFormatter= DateTimeFormatterBuilder()
.appendPattern("yyyy-MM-dd")
.toFormatter()
val begin = (LocalDateTime.parse("2019-11-04", dateFormatter).atOffset(ZoneOffset.UTC)
.toInstant()).atZone(ZoneId.of(timeZoneIdentifier))
当我尝试像这样解析日期时,出现以下错误:
无法解析文本“2019-11-04”:无法从 TemporalAccessor 获取 LocalDateTime:DateTimeBuilder[, ISO, null, 2019-11-04, null], type org.threeten.bp.format.DateTimeBuilder