Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static int getDistanceMinute(Calendar cFrom, Calendar cTo) { int distance = 0; ; long from = cFrom.getTimeInMillis(); long to = cTo.getTimeInMillis(); long resultSeconds = to - from; distance = (int) (resultSeconds / (60 * 1000)); return distance; } }