Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { private static long getDaysBetweenDates(Date d2) { return TimeUnit.MILLISECONDS.toDays(System.currentTimeMillis() - d2.getTime()); } }