Bug #52342 [Opn->Asn]: DateTime setIsoDate results in wrong timestamp
| From: | felipe@php.net | Date: | Sun, 18 Jul 2010 18:21:51 +0000 |
| Subject: | Bug #52342 [Opn->Asn]: DateTime setIsoDate results in wrong timestamp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-152501@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52342&edit=1
ID: 52342
Updated by: felipe@php.net
Reported by: freund at lotum dot de
Summary: DateTime setIsoDate results in wrong timestamp
-Status: Open
+Status: Assigned
Type: Bug
Package: Date/time related
Operating System: Debian Lenny
PHP Version: 5.3.2
-Assigned To:
+Assigned To: derick
Previous Comments:
------------------------------------------------------------------------
[2010-07-15 08:41:58] freund at lotum dot de
Description:
------------
Try to get Midnight of the first Weekday of a Weeknumber of a specific
year:
$from = new DateTime();
$from->setTime(0, 0, 0);
$from->setISODate(2010, 28, 1); //Montag der 28ten Woche 2010
echo $from->format('d.m.Y H:i'); //A
echo $from->getTimestamp(); //B
echo date('Y-m-d H:i', $from->getTimestamp()); //C
The result is as expected, after adding an interval of 0 Days:
$from->add(new DateInterval('P0D'));
Expected result:
----------------
12.07.2010
1278885600
12.07.2010 00:00
Actual result:
--------------
12.07.2010
1291849200
29.05.2011 00:00
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52342&edit=1