Red Hat Bugzilla – Bug 187533
strtotime Date Calculation Error - February
Last modified: 2007-11-30 17:11:29 EST
Description of problem:
Please note that PHP reports "not a bug." I disagree. This applies to both FC4
Version-Release number of selected component (if applicable):
php-5.1.2-5 and php-5.0.4-10.5
If current date = March 30 or March 31:
$lastmonth=date('Y-m',strtotime("-1 month 1 day"));
Thanks for the report.
The PHP strtotime interface aims to be compatible with the GNU "Date Input
Format" syntax, per the PHP strtotime manual page. Under that syntax, the
behaviour implemented here is as expected; it even gives a similar case an example.
I cannot see any reason to disagree with the upstream response on this.