Java Second Get getNumberOfSecondsBetween(final double d1, final double d2)

Here you can find the source of getNumberOfSecondsBetween(final double d1, final double d2)

Description

get Number Of Seconds Between

License

Open Source License

Declaration

public static int getNumberOfSecondsBetween(final double d1, final double d2) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from   w w w.  ja  v  a2 s.c o m
     * milliseconds in a second.
     */
    public static final long SECOND = 1000;

    public static int getNumberOfSecondsBetween(final double d1, final double d2) {
        if ((d1 == 0) || (d2 == 0)) {
            return -1;
        }

        return (int) (Math.abs(d1 - d2) / SECOND);
    }
}

Related

  1. getFramesFromSeconds(Double seconds)
  2. getMSTimeInSeconds(final String timeStr)
  3. getMultiplierForCmPerSecondsFromSpeedUnits(String speedUnits)
  4. getNbSecondsFromHour(int hour)
  5. getNiceStringForSeconds(String timeInSeconds)
  6. getRemainingSeconds(final long ms)
  7. getRoundedSeconds(long seconds, long interval)
  8. getSecond(long container)
  9. getSecond(long time)