Java Duration Calculate daysRoundingUp(Duration duration)

Here you can find the source of daysRoundingUp(Duration duration)

Description

days Rounding Up

License

Open Source License

Declaration

public static long daysRoundingUp(Duration duration) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.time.Duration;

public class Main {
    public static long daysRoundingUp(Duration duration) {
        final long days = duration.toDays();
        return duration.equals(Duration.ofDays(days)) ? days : days + 1;
    }//  w w w.jav  a 2  s.c o m
}

Related

  1. adjustServerTimeout(Duration clientTimeout)
  2. awaitTermination(ExecutorService service, Logger logger, Duration timeout, String technique)
  3. calculateDuration(Duration minimum, Duration maximum, Long iteration)
  4. delayedFuture(Duration delay, ScheduledExecutorService executorService)
  5. durationFromNow(TemporalAmount duration)
  6. failAfter(Duration duration)
  7. futureWithTimeout(Duration timeout, ScheduledExecutorService executorService)