Bug #53740 [Opn->Bgs]: DateTime, create_date, strtotime - wrong result on realtive date time string

From: Date: Fri, 14 Jan 2011 11:11:28 +0000
Subject: Bug #53740 [Opn->Bgs]: DateTime, create_date, strtotime - wrong result on realtive date time string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-157907@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53740&edit=1 ID: 53740 Updated by: derick@php.net Reported by: metwo at gmx dot net Summary: DateTime, create_date, strtotime - wrong result on realtive date time string -Status: Open +Status: Bogus Type: Bug Package: Date/time related Operating System: Linux 2.6.36.3 x86_64 PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This was broken in < 5.3.3, you need to use the "first day of" phrase (and not use "first day"). "first day" means the same as "next day" (and always has). Previous Comments: ------------------------------------------------------------------------ [2011-01-13 17:12:53] metwo at gmx dot net Expected and actual result relative to current date/time - 2011-01-13 17:12 ------------------------------------------------------------------------ [2011-01-13 17:10:44] metwo at gmx dot net Description: ------------ parsing of "midnight first day last month" returns a wrong result in php 5.3.5 (worked correct in php 5.3.2) Test script: --------------- <?php print_r(date_create('midnight first day last month')); print date('Y-m-d H:i:s', strtotime('midnight first day last month')); Expected result: ---------------- DateTime Object ( [date] => 2010-12-01 00:00:00 [timezone_type] => 3 [timezone] => Europe/Berlin ) 2010-12-01 00:00:00 Actual result: -------------- DateTime Object ( [date] => 2010-12-14 00:00:00 [timezone_type] => 3 [timezone] => Europe/Berlin ) 2010-12-14 00:00:00 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53740&edit=1

« previous php.bugs (#157907) next »