Java TimeUnit.toDays(long duration)

Syntax

TimeUnit.toDays(long duration) has the following syntax.

public long toDays(long duration)

Example

In the following code shows how to use TimeUnit.toDays(long duration) method.


import java.util.concurrent.TimeUnit;
/*from  w  w w.j a  va  2 s.  c  o  m*/
public class Main {
  public static void main(String[] args) {
    TimeUnit tu = TimeUnit.DAYS;

    System.out.println(tu.toDays(1));
    System.out.println(tu.toHours(1));
    System.out.println(tu.toMinutes(1));

  }
}




















Home »
  Java Tutorial »
    java.util.concurrent »




ArrayBlockingQueue
BlockingDeque
CountDownLatch
CyclicBarrier
TimeUnit