Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static long getCountDownDays(int dayMonth, int month, int year) { Calendar thatDay = Calendar.getInstance(); thatDay.set(Calendar.DAY_OF_MONTH, dayMonth); thatDay.set(Calendar.MONTH, month - 1); // 0-11 so 1 less thatDay.set(Calendar.YEAR, year); Calendar today = Calendar.getInstance(); long diff = thatDay.getTimeInMillis() - today.getTimeInMillis(); return diff / (24 * 60 * 60 * 1000); } }