public static void main(String[] args) {
  SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
  try {
   Long current = sdf.parse("2013/01/01").getTime();
   Long birth = sdf.parse("1990/01/01").getTime();
   Long age = (current-birth)/(1000*60*60*24)/365;
   System.out.println(age);
  } catch (ParseException e) {
   e.printStackTrace();
  }
 }结果:23 public static void main(String[] args) {
  SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
  try {
   Long current = sdf.parse("2013/01/01").getTime();
   Long birth = sdf.parse("1990/01/01").getTime();
   Long age = (current-birth)/(1000*60*60*24*365);
   System.out.println(age);
  } catch (ParseException e) {
   e.printStackTrace();
  }
 }结果:493 public static void main(String[] args) {
  SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
  try {
   Long current = sdf.parse("2013/01/01").getTime();
   Long birth = sdf.parse("1990/01/01").getTime();
   Long age = (current-birth)/(1000*60*60*24);
   System.out.println((int)(age/365));
  } catch (ParseException e) {
   e.printStackTrace();
  }
 }结果:23什么情况.....
SimpleDateFormat