minutes Between - Java java.util

Java examples for java.util:Minute

Description

minutes Between

Demo Code


//package com.java2s;

import java.util.Date;

public class Main {
    public static double minutesBetween(Date date1, Date date2) {
        long gapInMilliseconds = date2.getTime() - date1.getTime();
        return Math.abs(gapInMilliseconds / (double) (1000 * 60));
    }//www.  j a va 2  s  .  c  o m
}

Related Tutorials