LocalDateTime与时间戳互转

Long timestamp = 1686190888000L;
LocalDateTime localDateTime = Instant.ofEpochMilli(timestamp).atZone(ZoneOffset.ofHours(8)).toLocalDateTime();
localDateTime = localDateTime.plusMinutes(1);
Long time = localDateTime.toInstant(ZoneOffset.ofHours(8)).toEpochMilli();

你可能感兴趣的:(java)