Skip to content

is_leap_year

time · scripts/time/is_leap_year.m

IS_LEAP_YEAR  True for proleptic Gregorian leap years (Octave name).
  TF = IS_LEAP_YEAR(Y) is true where Y is divisible by 4, except
  centuries not divisible by 400. Non-integer and non-finite values
  are false. With no argument, the current calendar year is tested
  (via clock).
  MATLAB has no public is_leap_year; portable code uses eomday or
  calendar math. Unmarked MATLAB-mode scripts that never call this
  name are unaffected.

  See also EOMDAY, DATENUM, YEAR, CLOCK.