Java 8 Offset Date Parsing
问题 I need to parse a String in the following format 2015-01-15-05:00 to LocalDate(or smth else) in UTC. The problem is that the following code: System.out.println(LocalDate.parse("2015-01-15-05:00", DateTimeFormatter.ISO_OFFSET_DATE)); outputs 2015-01-15 ignoring the offset. The desired output is 2015-01-16 Thanks in advance! 回答1: The simplest answer is to use OffsetDateTime to represent the data, but you need to default the time: DateTimeFormatter fmt = new DateTimeFormatterBuilder() .append