I've also tried to work on a similar problem in the past ( I'm also new to java and working on demo programs to get acquainted with java APIs). I passed two Date objects to a method that would call getTime() method on the two date objects and subtract the two times in milliseconds and then divide the result by 3600*24*1000 to compute the number of days. But I don't like that approach. I wanna also try the solution proposed by you. But I don't know how to create a GregorianCalendar corresponding to now. Could you please explain how to do that too.