Bug #52142 [Opn->Asn]: using diff change the datetime object
| From: | tony2001@php.net | Date: | Tue, 22 Jun 2010 13:38:56 +0000 |
| Subject: | Bug #52142 [Opn->Asn]: using diff change the datetime object | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-151768@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52142&edit=1
ID: 52142
Updated by: tony2001@php.net
Reported by: riccardo at mercuriosistemi dot com
Summary: using diff change the datetime object
-Status: Open
+Status: Assigned
Type: Bug
Package: Date/time related
Operating System: slackware
PHP Version: 5.3.2
-Assigned To:
+Assigned To: derick
Previous Comments:
------------------------------------------------------------------------
[2010-06-22 12:40:46] riccardo at mercuriosistemi dot com
Description:
------------
A DateTime object with timezone_type=1 is always set to timezone=+00:00
after the use of diff
Test script:
---------------
date_default_timezone_set( "Europe/Rome" );
$da = new DateTime('2010-06-22T00:00:00+02:00');
$a = new DateTime('2010/06/23');
print_r($da);
$da->diff($a);
// $da has been changed
print_r($da);
Expected result:
----------------
DateTime Object
(
[date] => 2010-06-22 00:00:00
[timezone_type] => 1
[timezone] => +02:00
)
DateTime Object
(
[date] => 2010-06-21 22:00:00
[timezone_type] => 1
[timezone] => +02:00
)
Actual result:
--------------
DateTime Object
(
[date] => 2010-06-22 00:00:00
[timezone_type] => 1
[timezone] => +02:00
)
DateTime Object
(
[date] => 2010-06-21 22:00:00
[timezone_type] => 1
[timezone] => +00:00
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52142&edit=1