isInLeapYear method

bool isInLeapYear ()

Returns true if this DateTime object is in a leap year with 366 days.

Implementation

bool isInLeapYear() {
  if ((year % 400) == 0) return true;
  if (((year % 4) == 0) && ((year % 100) != 0)) return true;
  return false;
}