Description

Determines whether a year is a leap year.

Returns

True, if year is a leap year; False, otherwise.

Category

Syntax

IsLeapYear(year)

See also

Parameters

Parameter

Description

year

Number representing a year

Example

<cfscript>
    year = 2016;
    month = 2;
    day = 28;
    curyear = 2018;
    myDate=CreateDate(year,month,day)  
    leapyear = IsLeapYear(myDate);
    writeoutput("Was #year# a leap year? : " & leapyear & "<br>");
    leapyr = ISLeapYear(curyear);
    writeOutput("Is #curyear# a leap year? : " & leapyr);
</cfscript>

Output

Was 2016 a leap year? : YES
Is 2018 a leap year? : NO

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy