Jump to content


Photo

Something Wrong :/


  • Please log in to reply
1 reply to this topic

#1 Randy

Randy
  • Members
  • PipPip
  • Member
  • 25 posts
  • LocationNewcastle, UK

Posted 03 March 2006 - 10:15 PM

Date = new Date();
Year = parseFloat(Date.getYear());
if((round((Year+1900)/4)) == ((Year+1900)/4)){
    leap = 29;
}else{
    leap = 28;
}

something seems to be wrong, i don't really know what...

thanks in advance

#2 fusionpixel

fusionpixel
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 06 March 2006 - 12:26 PM

It is Math.round instead of just round.

Date = new Date();
Year = parseFloat(Date.getYear());
if((Math.round((Year+1900)/4)) == ((Year+1900)/4)){
    leap = 29;
}else{
    leap = 28;
}

Did you know there is a manual for PHP? [a href="http://" target="_blank"]http://www.php.net[/a]
Did you know there is a manual for mySQL? [a href="http://" target="_blank"]http://www.mysql.org[/a]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users