活到今天,我才知道我活了9823天
public void fetchAge(String birthday) throws ParseException {SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd");Date birthDate = format.parse(birthday);Date now = new Date(System.currentTimeMillis());now.compareTo(birthDate);System.out.println(birthDate);System.out.println(now);Calendar cal = Calendar.getInstance(); cal.setTime(birthDate); long time1 = cal.getTimeInMillis(); cal.setTime(now); long time2 = cal.getTimeInMillis(); long between_days=(time2-time1)/(1000*3600*24);System.out.println(between_days);}
?
?
?
岁月啊,你能慢点吗。