Java Day of getFullAge(Date birthday)

Here you can find the source of getFullAge(Date birthday)

Description

get Full Age

License

Apache License

Declaration

public static int getFullAge(Date birthday) 

Method Source Code

//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;
    }
}

Related

  1. getFirstDayInThisQuarter(String nowDate)
  2. getFirstDayOfQuarter(Date date)
  3. getFirstOfDay(Date date)
  4. getFirstTimeInDay(Date day)
  5. getFormattedNowDatePlusDays(int days, String dateFormat)
  6. getIncrementDaysSecond(String strDate, int sec)
  7. getInsertDayDate(int days)
  8. getIntervalDate(String date, int intervalDays)
  9. getIntervalDays(Date fDate, Date oDate)