|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-11-24 21:14 UTC] derick@php.net
-Status: Open
+Status: Not a bug
[2013-11-24 21:14 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 14:00:02 2025 UTC |
Description: ------------ The formatting of the hour offset in date_format()/DateTime->format() differs from the one in date(). Both are correct according to the ISO-8601 specification, though I would expect a consistent format. Test script: --------------- date_default_timezone_set("Europe/Amsterdam"); $timeStamp = 1276592400; $dateTest = new DateTime(date('c', $timeStamp)); echo $dateTest->format(DateTime::ISO8601) ."\n"; echo date_format($dateTest, DateTime::ISO8601)."\n"; echo date('c', $timeStamp) ."\n"; Expected result: ---------------- EITHER 1276592400 2010-06-15T11:00:00+0200 2010-06-15T11:00:00+0200 2010-06-15T11:00:00+0200 OR 1276592400 2010-06-15T11:00:00+02:00 2010-06-15T11:00:00+02:00 2010-06-15T11:00:00+02:00 Actual result: -------------- 1276592400 2010-06-15T11:00:00+0200 2010-06-15T11:00:00+0200 2010-06-15T11:00:00+02:00