IsLeapYear

Description

Determines whether a year is a leap year.

Return value

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

Category

Date and time functions, Decision functions

Syntax

IsLeapYear(year)

See also

DaysInYear

Parameters

Parameter Description
year
Number representing a year

Example

<h3>IsLeapYear Example</h3>

<cfif IsDefined("FORM.theTestValue")>
  <cfif IsLeapYear(FORM.theTestValue)>
    <h3>The year value <cfoutput>#DE(FORM.theTestValue)#</cfoutput> is a Leap Year</h3>
  <cfelse>
    <h3>The year value <cfoutput>#DE(FORM.theTestValue)#</cfoutput> is not a Leap Year</h3>
  </cfif>
</cfif>

<form action = "isLeapYear.cfm">
<p>Enter a year value, and find out whether it is a Leap Year.
<p><input type = "Text" name = "TheTestValue" value = "
<cfoutput>#Year(Now())#</cfoutput>">
<input type = "Submit" value = "Is it a Leap Year?" name = "">
</form>

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt1134.htm