The example of this article tells the method of the number of days between Java acquisition date. Share it for everyone for your reference. The specific implementation method is as follows:
Private Int Daysbetween (Date Now, Date Returndate) {Calendar CNOW = CALENDAR.GetInstance (); Calendar Creturndate = Calendar.GetInstance (); CNOW.Settime w); CreturNDate.Settime (ReturNDate); Settimetomidnight (CNOW); Settimetomidnight ( creturNDate); Long TODAYMS = CNOW.GettimeInmillis (); Long Returnms = CreturNDate.gettimeinmillis (); Long Internet RN MilliseCondStodays (intervalms);} Private Int MilliseCondStodays (Long Intervalms) {RETURN (int) (Internet) (Internet) (Internet) (Internet) (1000 * 86400));} Private Void Settimetomidnight (Calendar Calendar) {Calendar.Set (Calendar.hour_of_DAY, 0); Calendar.Set (Calendar.minute, 0); Calen dar.set (Calendar.Second, 0);}
It is hoped that this article is helpful to everyone's Java program design.