Here you can find the source of differDayByNow(Timestamp timestamp)
public static int differDayByNow(Timestamp timestamp)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; public class Main { public static int differDayByNow(Timestamp timestamp) { return (int) (differMsByNow(timestamp) / 1000 / 60 / 60 / 24); }/*w ww . j ava 2s .c o m*/ public static long differMsByNow(Timestamp timestamp) { long now = System.currentTimeMillis(); long time = timestamp.getTime(); long diff = now - time; return diff; } }