|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesbug_63615_patch_2_memleak_fixed (last revision 2012-12-06 15:26 UTC by njaguar at gmail dot com)bug_63615_fix_patch.txt (last revision 2012-12-05 22:29 UTC by njaguar at gmail dot com) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-01-04 21:00 UTC] stas@php.net
-Assigned To:
+Assigned To: derick
[2013-01-06 16:26 UTC] derick@php.net
[2017-03-19 10:58 UTC] heiglandreas@php.net
-Status: Assigned
+Status: Wont fix
[2017-03-19 10:58 UTC] heiglandreas@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 00:00:02 2025 UTC |
Description: ------------ DateTime::modify() ignores the timezone (when using the RFC 2822 format for instance). The right timestamp should be $t1 (from the example below). Test script: --------------- <?php $str = "Tue, 10 Apr 2012 11:27:56 +0300"; $d1 = new DateTime($str); $d2 = new DateTime; $d2->modify($str); $t1 = $d1->getTimestamp(); $t2 = $d2->getTimestamp(); $tz1 = $d1->getTimezone()->getName(); $tz2 = $d2->getTimezone()->getName(); $f1 = $d1->format(DateTime::RFC2822); $f2 = $d2->format(DateTime::RFC2822); var_dump(compact('t1', 't2', 'tz1', 'tz2', 'f1', 'f2')); /* array(6) { 't1' => int(1334046476) 't2' => int(1334050076) 'tz1' => string(6) "+03:00" 'tz2' => string(13) "Europe/Vienna" 'f1' => string(31) "Tue, 10 Apr 2012 11:27:56 +0300" 'f2' => string(31) "Tue, 10 Apr 2012 11:27:56 +0200" } */ Expected result: ---------------- $t1 == $t2 Actual result: -------------- $t1 != $t2