根据生日计算距离今天几年几个月几天
1Date birthday = xxxxxxxx 2Calendar now = Calendar.getInstance(); 3 Calendar b = Calendar.getInstance(); 4 b.setTime(birthday); 5 int year = now.get(Calendar.YEAR) - b.get(Calendar.YEAR); 6 int month = now.get(Calendar.MONTH) - b.get(Calendar.MONTH); 7 int day = now.get(Calendar.DAY_OF_MONTH) - b.get(Calendar.DAY_OF_MONTH); 8 if (month < 0) { 9 month = 12 - b.get(Calendar.MONTH) + now.get(Calendar.MONTH); 10 year -= 1; 11 } 12 if (day < 0) { 13 day = b.getMaximum(Calendar.DAY_OF_MONTH) - b.get(Calendar.DAY_OF_MONTH) + now.get(Calendar.DAY_OF_MONTH); 14 month -= 1; 15 } 16 // year + "岁" + month + "个月" + day + "天";