1public static String getAge(String birthdate) throws ParseException {
2 LocalDate parsed = LocalDate.parse("1970-01-01");
3 LocalDate current = LocalDate.now();
4
5 Period p = Period.between(parsed, current);
6
7 // Returns time between date and now
8 return p.getYears() + " Years, " + p.getMonths() + " Months, " + p.getDays() + " Days";
9 }
1You can use calendar
2calendarMilis = c.timeInMillis.toInt() - System.currentTimeMillis().toInt()