Java Day Of Year getFirstDayOfTheYear(int year)

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

Description

get First Day Of The Year

License

Open Source License

Declaration

public static Date getFirstDayOfTheYear(int year) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date getFirstDayOfTheYear(int year) {

        // get first day of the year
        Calendar firstDayOfThisYear = Calendar.getInstance();
        firstDayOfThisYear.clear();/*from   w  w  w  .ja  va 2  s .  com*/
        firstDayOfThisYear.set(Calendar.YEAR, year);
        firstDayOfThisYear.set(Calendar.DAY_OF_YEAR, 1);

        return firstDayOfThisYear.getTime();
    }
}

Related

  1. getDaysInYear(final int year)
  2. getDaysInYear(int year)
  3. getDaysInYear(int year)
  4. getDaysOfYear(int year)
  5. getEndTimeOfYear(int year)
  6. getFirstDayOfYear(int year)
  7. getLastYearOfToday()
  8. getMaxDayByYearMonth(String ym)
  9. getMaxDayOfYearMonth(String date)