我输入的是19.12.0009,预计12月19日00:00:00HKT 9,但返回的是12月21日00:23:18香港时间9,为什么? 代码如下:
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.uuuu")
.withResolverStyle(ResolverStyle.STRICT);
LocalDate localDate = LocalDate.parse("19.12.0009", formatter);
Instant instant = Instant.from(localDate.atStartOfDay(ZoneId.of("Asia/Hong_Kong")));
Date resultDate = Date.from(instant);
System.out.println("resultDate" + resultDate);