note 94485 modified in function.date by danbrown
| From: | danbrown@php.net | Date: | Sun, 08 Nov 2009 16:21:23 +0000 |
| Subject: | note 94485 modified in function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162646@lists.php.net to get a copy of this message | ||
Find whether the leap year or not with simple function, check by the last day in February is 29 or
not.
<?php
function IsLeapYear($Year)
{
$Year = ($Year >= 2300)? ($Year-543):$Year ; // if check by B.E year (Buddhist era)
return (date("d",mktime(0,0,0,3,0,$Year)) == 29)? TRUE:FALSE;
}
?>
--was--
Find whether the leap year or not with simple function, check by the last day in February is 29 or
not.
function IsLeapYear($Year)
{
$Year = ($Year >= 2300)? ($Year-543):$Year ; // if check by B.E year (Buddhist era)
return (date("d",mktime(0,0,0,3,0,$Year)) == 29)? TRUE:FALSE;
}
http://php.net/manual/en/function.date.php