note 11827 modified in function.mktime.php by jeroen

From: Date: Tue, 10 Jul 2001 21:49:37 +0000
Subject: note 11827 modified in function.mktime.php by jeroen
Groups: php.notes 
Request: Send a blank email to php-notes+get-15184@lists.php.net to get a copy of this message
He up above said: "Feb 2000 was a leap year. I don't remember the algorythm, but just run cal on any unix system for year 2000, and you'll see." The algorith is 'if the year is divisible by 400 then it's not a leap year'. Year 2000 is divisible by 400 and is not a leap year. Year 2100 is divisible by 4 so we would expect it to be a leap year, and since it is not divisible by 400 it WILL be a leap year. [Editors note: Look it up in an encyclopedia if you're unsure, it's a little bit different: if (year divisible_by 400) leap_year elseif (year divisible_by 100) no_leap_year elseif (year divisible_by 4) leap_year else no_leap_year So 2000 _was_ a leap year. This did not break the habit of each 4th year, 1900 and 2100 are the nearest years which are no leap-years, even though they come 4 years after a leapyear. --jeroen] http://www.php.net/manual/en/function.mktime.php.php

« previous php.notes (#15184) next »