Android Date Interval Get minutesBetween(Date dt1, Date dt2)

Here you can find the source of minutesBetween(Date dt1, Date dt2)

Description

minutes Between

License

Open Source License

Declaration

public static int minutesBetween(Date dt1, Date dt2) 

Method Source Code

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

import java.util.Date;

public class Main {
    public static int minutesBetween(Date dt1, Date dt2) {
        long msDiff = millisecondsBetween(dt1, dt2);
        if (msDiff == 0)
            return 0;
        return (int) (msDiff / 60000);
    }/*from  ww  w  . j a v a 2s .  com*/

    public static long millisecondsBetween(Date dt1, Date dt2) {
        if (dt1 == null || dt2 == null)
            return 0;
        return Math.abs(dt1.getTime() - dt2.getTime());
    }
}

Related

  1. getIntervalYears(Date date1, Date date2)
  2. hoursBetweenDate(Date date1, Date date2)
  3. millisecondsBetween(Date dt1, Date dt2)
  4. millisecondsBetween(Date dt1, Date dt2)
  5. minuteBetweenDate(Date date1, Date date2)
  6. minutesBetween(Date dt1, Date dt2)
  7. offsetMinute(Date date, int offset)
  8. offsetSecond(Date date, int offset)
  9. secondBetweenDate(Date date1, Date date2)