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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: patrik at votocek dot cz
New email:
PHP Version: OS:

 

 [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 12:01:22 2021 UTC