Java Day Of Year getDaysInYear(int year)

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

Description

get Days In Year

License

Open Source License

Declaration

public static int getDaysInYear(int year) 

Method Source Code

//package com.java2s;

public class Main {

    public static int getDaysInYear(int year) {
        if (year > 1582) {
            if (year % 400 == 0)
                return 366;
            else if (year % 100 == 0)
                return 365;
            else if (year % 4 == 0)
                return 366;
            else//from   ww  w . j a v a  2  s  .  c o m
                return 365;
        } else if (year == 1582) {
            return 355;
        } else if (year > 4) {
            if (year % 4 == 0)
                return 366;
            else
                return 365;
        } else if (year > 0) {
            return 365;
        } else {
            return 0;
        }
    }
}

Related

  1. daysInYear(int yearInteger)
  2. firstdayofyear()
  3. getDayFromYear(String year)
  4. getDaysInYear(final int year)
  5. getDaysInYear(int year)
  6. getDaysOfYear(int year)
  7. getEndTimeOfYear(int year)
  8. getFirstDayOfTheYear(int year)
  9. getFirstDayOfYear(int year)