|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-10 16:33 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: derick
[2010-07-17 23:57 UTC] k.schroeder@php.net
[2011-01-30 11:18 UTC] stas@php.net
[2011-01-30 11:18 UTC] stas@php.net
-Status: Assigned
+Status: Closed
[2011-01-30 11:18 UTC] stas@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 22:00:01 2025 UTC |
Description: ------------ setDate, setISODate, setTime works wrong Test script: --------------- $tz = 'UTC'; date_default_timezone_set($tz); $ts = strtotime('2006-01-01'); $dt = new DateTime('@'.$ts); $dt->setTimezone(new DateTimeZone($tz)); echo $dt->format('o-\WW-N | Y-m-d | H:i:s | U'), "\n"; $dt->setISODate(2005, 52, 1); echo $dt->format('o-\WW-N | Y-m-d | H:i:s | U'), "\n"; $dt->setDate(2007, 10, 10); echo $dt->format('o-\WW-N | Y-m-d | H:i:s | U'), "\n"; $dt->setTime(20, 30, 40); echo $dt->format('o-\WW-N | Y-m-d | H:i:s | U'), "\n"; Expected result: ---------------- 2005-W52-7 | 2006-01-01 | 00:00:00 2005-W52-1 | 2005-12-26 | 00:00:00 2007-W40-5 | 2007-10-10 | 00:00:00 2007-W40-5 | 2007-10-10 | 20:30:40 Actual result: -------------- 2005-W52-7 | 2006-01-01 | 00:00:00 | 1136073600 2041-W52-4 | 2041-12-26 | 00:00:00 | 2271628800 2044-W40-1 | 2044-10-03 | 00:00:00 | 2359065600 2081-W39-6 | 2081-09-27 | 20:30:40 | 3526230640