gh ...我一辈子都想不通。我正在使用Java 8并尝试做一些简单的事情,例如解析时间戳,其中TimeZone ID是文本值,例如HST:
作品
ZonedDateTime timestamp = ZonedDateTime.parse("2018-10-29T12:00:12.456-10:00");
不起作用
ZonedDateTime timestamp = ZonedDateTime.parse("2018-10-29T12:00:12.456HST");
并得到这个错误:
java.time.format.DateTimeParseException: Text '2018-10-29T12:00:12.456HST' could not be parsed at index 23
有谁知道如何解析时区ID作为文本值的时间戳?
相关分类