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 Value | Description |
---|---|
True/False | Returns true if the date falls within a leap year, otherwise false. |
Sample
Example | Result | Description |
---|---|---|
isLeapYear(2024-01-01) | true | January 1st, 2024, falls within a leap year (2024 is a leap year), so the function returns true. |
isLeapYear(2023-01-01) | false | January 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
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article