|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-07-27 14:58 UTC] atanas at intransco dot com
$last_day = date ('t', mktime(1,1,1,$month,1,$year));
if (($year == '2000') and ($month == '02'))
{$last_day = 29;}
/* for building a calendar, I needed a loop from 1 to last_day_in_month
checkdate(..) returned correctly 29 for Feb 2000 as last valid day
getting straight at the last day using date('t',...) - the script above
returns 28 days
Of course, the "fix" is easy, but better fix the function internally:
Any year evenly divisible by 400 is a leap year!
*/
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Jun 30 23:00:01 2026 UTC |
It certainly does on my Linux box: eg. echo date ('t', mktime(1,1,1,2,29,2000)); This prints 29 for me. It doesn't on your box?