LocalDateTime 时间戳转换
long timestamp = Instant.now().toEpochMilli(); long timestamp = LocalDateTime.now().toInstant(ZoneOffset.ofHours(8)).toEpochMilli(); System.out.println(timestamp); LocalDateTime inputTime= LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneOffset.ofHours(8)); System.out.println(inputTime.toInstant(ZoneOffset.ofHours(8)).toEpochMilli());