Java Year Day getLastDayOfYear(int year)

Here you can find the source of getLastDayOfYear(int year)

Description

get Last Day Of Year

License

Open Source License

Declaration

public static Date getLastDayOfYear(int year) 

Method Source Code


//package com.java2s;
import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date getLastDayOfYear(int year) {
        return getEndDate(Calendar.DECEMBER, year);
    }//from   w  ww .j  a v  a2 s.  c om

    public static Date getEndDate(int month, int year) {
        Calendar calendar = Calendar.getInstance();

        calendar.set(Calendar.MONTH, month);

        calendar.set(Calendar.YEAR, year);

        calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));

        return calendar.getTime();
    }
}

Related

  1. getCurrYearFirstDay(int year)
  2. getFirstDay4CurrentYear()
  3. getFirstDayOfThisYear()
  4. getLastDayOfTheYear(int year)
  5. getLastDayOfYear(int year)
  6. getTodayYear()
  7. getWeekNumOfYearDay(String strDate)
  8. getYearFirstDay(String date)