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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 21 11:01:30 2025 UTC