Java TimeUnit Usage minutesBetween(Date date1, Date date2)

Here you can find the source of minutesBetween(Date date1, Date date2)

Description

minutes Between

License

Apache License

Declaration

public static long minutesBetween(Date date1, Date date2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static long minutesBetween(Date date1, Date date2) {
        long diffInMillies = date2.getTime() - date1.getTime();
        return TimeUnit.MINUTES.convert(diffInMillies, TimeUnit.MILLISECONDS);
    }//from  w ww.  j  a  v  a  2s.  c  o  m
}

Related

  1. millisToString(long ms)
  2. millisToStringConvert(long millis)
  3. millisToTime(long millis)
  4. millisToTimeDelta(long millis)
  5. min()
  6. minutesSince(final long startNanos)
  7. nanoElapseToHumanReadable(final Long nanoElapse)
  8. nanosToHMSms(long nanos)
  9. nanosToSecs(long nanos)