|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-06-23 15:22 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2016-06-23 15:22 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 00:00:01 2025 UTC |
Description: ------------ The DateTime::createFromFormat method seems to ignore the DateTimeZone parameter. On the sample script, $t should be Test script: --------------- $time = "2016-05-25 09:30:00"; // This is the expected timestamp considering $time is in UTC. $timestamp = 1464168600; $format = "Y-m-d H:i:s"; $date = \DateTime::createFromFormat($format, $time, new \DateTimeZone('America/Tegucigalpa')); $t = $date->format('U'); //1464190200 if ($t !== $timestamp) { throw new \Exception('¿??¿?¿'); } Expected result: ---------------- No exception thrown.