Thread: bisixth year
View Single Post
Old 08-27-2009, 09:20 PM   #5 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

I figured it was lost in translation once I saw you were from Portugal, but I put it though bablefish....

This will tell you if its leap year (the year that has 366 days in it)
PHP Code:
function isLeapYear(int year)
{
    if(
year == 0)
    {
        return 
true;
    }
    else
    {
        return 
false;
    }

Basically what the code does is use the modulo operator to see if the year can be divided by four without any remainder. If it can be divided by four, its leap year.
__________________

Village Idiot is offline  
Reply With Quote
The Following User Says Thank You to Village Idiot For This Useful Post:
pipesportugal (08-27-2009)