I m trying to get difference in miliseconds between current time and a certain day say 2013/12/25
I am using this code
Calendar thatDay = Calendar.getInstance();
thatDay.set(Calendar.DAY_OF_MONTH,25);
thatDay.set(Calendar.MONTH,11); // 0-11 so 1 less
thatDay.set(Calendar.YEAR, 2013);
Calendar today = Calendar.getInstance();
long diff = thatDay.getTimeInMillis() - today.getTimeInMillis();
long days = diff / (24 * 60 * 60 * 1000);
but this code some times give right value some time slightly difference..please help guys