Java Day From daysInFebruary(int year)

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

Description

Given integer argument year, returns number of days in February of that year.

License

Open Source License

Declaration

public static int daysInFebruary(int year) 

Method Source Code

//package com.java2s;

public class Main {
    /** Given integer argument year, returns number of days in February of that year. */
    public static int daysInFebruary(int year) {
        // February has 29 days in any year evenly divisible by four,
        // EXCEPT for centurial years which are not also divisible by 400.
        return (((year % 4 == 0) && ((!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28);
    }/*from   w ww  .j  a  v  a 2 s .c  o  m*/
}

Related

  1. days(int num)
  2. days(int year, int month)
  3. daysAfter(Date earlierDate, Date laterDate)
  4. daysAndHours(int hours)
  5. daysBetweenTime(long start, long end)
  6. daysInMonthForYear(int commonMonthIndex, int yearInteger)
  7. daysOfTwo(Date date1, Date date2)
  8. daysSince(Date since)
  9. dayStartTime(int day)