Here you can find the source of getDaysSince(Date date)
public static int getDaysSince(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Date; public class Main { private static final long ONE_DAY_IN_MILLIS = 24 * 60 * 60 * 1000; public static int getDaysSince(Date date) { if (date == null) { return 0; }// ww w . j a v a2s . c om return (int) ((getCurrentEpochTime() - date.getTime()) / ONE_DAY_IN_MILLIS); } private static long getCurrentEpochTime() { return new Date().getTime(); } }