Add Comment
Using the isLeapYear function
ColdFusion Tutorial #31
This tutorial will show you how to use the 'isLeapYear' function in ColdFusion.
demo.cfm
This code snippet will calculate the total number of days between 2010 and 2025. By all means, there are probably quicker and easier ways to do this. This is just a demo of 'isLeapYear' in action.Demo
See this code running!
Download
Download this code as a zip!
Comments
You mean faster like this?(yearHigh-yearLow)*365 + int((yearHigh-yearLow) / 4)
miked @ Saturday 21 Mar 2009 - 07:58:48 AM
While that method could be fast, it misses out by a day on certain yearLow/yearHigh settings.
My idea of fast would be:
DateDiff("d", CreateDate(yearLow, 1, 1), CreateDate((YearHigh + 1), 1, 1))
Thomas Stiegler @ Saturday 21 Mar 2009 - 01:18:55 PM
Click button to add a comment
Author
Thomas Stiegler