Here you can find the source of IsInLeapYear(Date date1)
Parameter | Description |
---|---|
date1 | Date object |
public static boolean IsInLeapYear(Date date1)
//package com.java2s; // it under the terms of the GNU General Public License as published by import java.util.*; public class Main { /** Indicates whether the year in the specified date is in a leap year. *//from ww w . ja v a2 s .c o m * @param date1 Date object * @return Whether the year is in a leap year */ public static boolean IsInLeapYear(Date date1) { GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date1); return cal.isLeapYear(cal.get(cal.YEAR)); } }