It sounds amazing:
(System.currentTimeMillis() - date.getTime()) / (24 * 60 * 60 * 1000d);
In other words, find out the difference between the current time and the given date in milliseconds, and then divide by the number of milliseconds per day. I explicitly made 1000d a double literal to do the final division in double arithmetic.
source share