Here you can find the source of getDiffInMinutes(Calendar startTime, Calendar endTime)
Parameter | Description |
---|---|
startTime | a parameter |
endTime | a parameter |
public static long getDiffInMinutes(Calendar startTime, Calendar endTime)
//package com.java2s; import java.util.Calendar; import java.util.concurrent.TimeUnit; public class Main { /**// ww w. ja va2s . c om * Returns the difference of two calendars in minutes * * @param startTime * @param endTime * @return difference of two calendars in minutes */ public static long getDiffInMinutes(Calendar startTime, Calendar endTime) { long diffMillis = Math.abs(endTime.getTimeInMillis() - startTime.getTimeInMillis()); return TimeUnit.MILLISECONDS.toMinutes(diffMillis); } }