|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-02-09 15:18 UTC] derick@php.net
[2012-02-09 15:18 UTC] derick@php.net
-Status: Open
+Status: Not a bug
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 04:00:01 2025 UTC |
Description: ------------ DateTime ignores Timezone: php -r '$d=new DateTime("2012-02-09T15:30:14+0100"); echo $d->format(DATE_ISO8601)."\n"; $d=new DateTime("2012-02-09T14:30:14+0000"); echo $d->format(DATE_ISO8601)."\n";' Output: 2012-02-09T15:30:14+0100 2012-02-09T14:30:14+0000 strtotime works as expected: php -r 'echo date(DATE_ISO8601, strtotime("2012-02-09T15:30:14+0100"))."\n"; echo date(DATE_ISO8601, strtotime("2012-02-09T14:30:14+0000"))."\n";' Output: 2012-02-09T15:30:14+0100 2012-02-09T15:30:14+0100 Test script: --------------- php -r '$d=new DateTime("2012-02-09T15:30:14+0100"); echo $d->format(DATE_ISO8601)."\n"; $d=new DateTime("2012-02-09T14:30:14+0000"); echo $d->format(DATE_ISO8601)."\n";' Expected result: ---------------- 2012-02-09T15:30:14+0100 2012-02-09T15:30:14+0100 Actual result: -------------- 2012-02-09T15:30:14+0100 2012-02-09T14:30:14+0000