Here you can find the source of getFullAge(Date birthday)
public static int getFullAge(Date birthday)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static int getFullAge(Date birthday) { if (birthday == null) { return 0; }//w w w .j a v a2 s. c om DateFormat df = new SimpleDateFormat("yyyyMMdd"); int start = Integer.parseInt(df.format(birthday)); int end = Integer.parseInt(df.format(new Date())); int fullAge = (end - start) / 10000; return fullAge; } }