note 58879 added to function.cal-days-in-month

From: Date: Fri, 18 Nov 2005 18:49:59 +0000
Subject: note 58879 added to function.cal-days-in-month
Groups: php.notes 
Request: Send a blank email to php-notes+get-98764@lists.php.net to get a copy of this message
> The date("t") doesn't work consistently. > > $lastdate = date("t", strtotime("february 1900")); > > sets $lastdate to 31 in 4.1. The answer should be 28. > cal_days_in_month correctly returns 28. You're facing two individual problems. 1) The furthest date back that strtotime() supports in PHP4 is 1970 or 1901 (depending on your system). In PHP4, strtotime() returns -1 instead of false when it fails. That's what's doing for you. 2) The date() function also has the same timeframe limitations. ---- Manual Page -- http://www.php.net/manual/en/function.cal-days-in-month.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58879 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58879&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58879&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58879&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58879&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58879&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58879&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58879&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58879&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#98764) next »