Java TimeUnit Usage secondsFromNow(long seconds)

Here you can find the source of secondsFromNow(long seconds)

Description

seconds From Now

License

Open Source License

Declaration

public static long secondsFromNow(long seconds) 

Method Source Code

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

import java.util.concurrent.TimeUnit;

public class Main {
    public static long secondsFromNow(long seconds) {
        return System.currentTimeMillis() + toMillis(seconds, TimeUnit.SECONDS);
    }/* w w  w  .  java 2 s.c  o m*/

    public static long toMillis(long duration, TimeUnit timeUnit) {
        return TimeUnit.MILLISECONDS.convert(duration, timeUnit);
    }
}

Related

  1. rangeOf(final Date date, final int beforeDates, final int afterDates)
  2. roundTimestampToNexDay(long timestamp)
  3. run(Callable task, long timeout)
  4. second(long second)
  5. seconds(long timeInMillis)
  6. secondsPassed(int startTime)
  7. secondsToETA(long secondsTotal)
  8. secondsToHMS(long seconds)
  9. secondsToMillis(int seconds)