Using new method in Time Unit
import java.util.concurrent.TimeUnit;
public class TimeUnitSample
{
public static void main(String args[])
{
TimeUnitSample () ;
}
public static void TimeUnitSample()
{
TimeUnit t = TimeUnit.DAYS;
System.out.println(t.toDays(1));
public static void TimeUnitSample()
{
TimeUnit t = TimeUnit.DAYS;
System.out.println(t.toDays(1));
System.out.println(t.toHours(1));
System.out.println(t.toMinutes(1));
}
}