/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
try { date = formatter.parse(trailLoginDate); // TODO: handle exception } calendar1.setTime(date); long milliseconds1 = calendar1.getTimeInMillis(); long milliseconds2 = calendar2.getTimeInMillis(); long diff = milliseconds2 - milliseconds1; long diffDays = diff / (24 * 60 * 60 * 1000); days = (int)diffDays;