isLeapYear

Modified on Tue, 22 Aug 2023

Description

Use this function to check if the given date falls within a leap year. It will return true if the date is in a leap year, and false otherwise.

Syntax

isLeapYear(date)

Returns

Return ValueDescription
True/FalseReturns true if the date falls within a leap year, otherwise false.

Sample

ExampleResultDescription
isLeapYear(2024-01-01)trueJanuary 1st, 2024, falls within a leap year (2024 is a leap year), so the function returns true.
isLeapYear(2023-01-01)falseJanuary 1st, 2023, does not fall within a leap year (2023 is not a leap year), so the function returns false.

To view all the Date functions, click here.

See Also