📜  在java代码示例中获取直到下一个小时开始的时间

📅  最后修改于: 2022-03-11 14:52:32.688000             🧑  作者: Mango

代码示例1
LocalDateTime start = LocalDateTime.now();
    // Hour + 1, set Minute and Second to 00
    LocalDateTime end = start.plusHours(1).truncatedTo(ChronoUnit.HOURS);

    // Get Duration
    Duration duration = Duration.between(start, end);
    long millis = duration.toMillis();