Here you can find the source of millisDiff(Calendar c1, Calendar c2)
public static long millisDiff(Calendar c1, Calendar c2)
//package com.java2s; import java.util.Calendar; public class Main { public static long millisDiff(Calendar c1, Calendar c2) { long time1 = c1.getTimeInMillis(); long time2 = c2.getTimeInMillis(); return Math.abs(time1 - time2); }//ww w. j a v a 2 s . c o m }