Java Calendar Different minutesDiff(Calendar c1, Calendar c2)

Here you can find the source of minutesDiff(Calendar c1, Calendar c2)

Description

minutes Diff

License

Open Source License

Declaration

public static double minutesDiff(Calendar c1, Calendar c2) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {
    public static double minutesDiff(Calendar c1, Calendar c2) {
        return secondsDiff(c1, c2) / 60.0;
    }//from  w  w w . java2  s . co  m

    public static double secondsDiff(Calendar c1, Calendar c2) {
        return millisDiff(c1, c2) / 1000.0;
    }

    public static long millisDiff(Calendar c1, Calendar c2) {
        long time1 = c1.getTimeInMillis();
        long time2 = c2.getTimeInMillis();
        return Math.abs(time1 - time2);
    }
}

Related

  1. getTimeDifference(String unit, Calendar start, Calendar end)
  2. getTimeDiffSecond(Calendar first, Calendar second)
  3. getWeekDifference(Calendar before, Calendar after)
  4. getYearDifference(GregorianCalendar fromCalendar, GregorianCalendar toCalendar)
  5. millisDiff(Calendar c1, Calendar c2)
  6. reduceAndCorrect(Calendar start, Calendar end, int field, int difference)
  7. timeDiff(Calendar c1, Calendar c2)