php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65765 createFromFormat('U') ignore current timezone
Submitted: 2013-09-26 11:25 UTC Modified: 2013-09-26 11:33 UTC
From: patrik at votocek dot cz Assigned:
Status: Closed Package: Date/time related
PHP Version: 5.5.4 OS: Linux x86_64
Private report: No CVE-ID: None
 [2013-09-26 11:25 UTC] 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"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-26 11:33 UTC] patrik at votocek dot cz
-Status: Open +Status: Closed
 [2013-09-26 11:33 UTC] patrik at votocek dot cz
It's not bug it's feature...
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jan 25 09:01:25 2021 UTC