Java TimeUnit Usage toUnixTime(Date date)

Here you can find the source of toUnixTime(Date date)

Description

to Unix Time

License

Open Source License

Declaration

public static long toUnixTime(Date date) 

Method Source Code

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

import java.util.Date;
import java.util.concurrent.TimeUnit;

public class Main {
    public static long toUnixTime(Date date) {
        return toUnixTime(date.getTime());
    }/*from ww w  .j  a v a 2  s  .co m*/

    public static long toUnixTime(long millisSinceEpoch) {
        return TimeUnit.MILLISECONDS.toSeconds(millisSinceEpoch);
    }
}

Related

  1. todayStart()
  2. toHeaderValue(long timeoutNanos)
  3. toMsTime(final String value)
  4. toString(final Stopwatch watch)
  5. toString(long milliseconds)
  6. unixToJavaTime(long utime)
  7. waitFor(long period)
  8. waitFor(Object obj)
  9. waitFor(Semaphore semaphore, long timeoutInMillis)