Bug #65765 [Opn->Csd]: createFromFormat('U') ignore current timezone

From: Date: Thu, 26 Sep 2013 11:33:47 +0000
Subject: Bug #65765 [Opn->Csd]: createFromFormat('U') ignore current timezone
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-181784@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65765&edit=1 ID: 65765 User updated by: patrik at votocek dot cz Reported by: patrik at votocek dot cz Summary: createFromFormat('U') ignore current timezone -Status: Open +Status: Closed Type: Bug Package: Date/time related Operating System: Linux x86_64 PHP Version: 5.5.4 Block user comment: N Private report: N New Comment: It's not bug it's feature... Previous Comments: ------------------------------------------------------------------------ [2013-09-26 11:25:14] patrik at votocek dot cz Description: ------------ DateTime::createFromFormat('U', $time); ignore current timezone. Test script: --------------- <?php $time = time(); var_dump(date('r', $time)); var_dump(\DateTime::createFromFormat('U', $time)->format('r')); Expected result: ---------------- string(31) "Thu, 26 Sep 2013 13:17:37 +0200" string(31) "Thu, 26 Sep 2013 13:17:37 +0200" Actual result: -------------- string(31) "Thu, 26 Sep 2013 13:17:37 +0200" string(31) "Thu, 26 Sep 2013 11:17:37 +0000" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65765&edit=1

« previous php.bugs (#181784) next »