php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68204 getTimeStamp alters actual time stamp
Submitted: 2014-10-10 07:09 UTC Modified: 2015-05-18 13:34 UTC
Votes:5
Avg. Score:2.6 ± 1.5
Reproduced:2 of 4 (50.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: Octuro at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: Date/time related
PHP Version: 5.5.17 OS: Ubuntu14.04
Private report: No CVE-ID: None
 [2014-10-10 07:09 UTC] Octuro at gmail dot com
Description:
------------
PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep  4 2014 06:56:34) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
   with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"

Test script:
---------------
$objDateTime = new \DateTime("26 October 2014 00:15:00 +0000");
$objDateTime->setTimeZone(new \DateTimeZone('UTC'));
var_dump($objDateTime->format("d F Y H:i:s O"));

$objDateTime->setTimeZone(new \DateTimeZone('Europe/London'));
var_dump($objDateTime->format("d F Y H:i:s O"));
var_dump($objDateTime->getTimeStamp());
var_dump($objDateTime->format("d F Y H:i:s O"));

Expected result:
----------------
string(30) "26 October 2014 00:15:00 +0000"
string(30) "26 October 2014 01:15:00 +0100"
int(1414282500)
string(30) "26 October 2014 01:15:00 +0100"

Actual result:
--------------
string(30) "26 October 2014 00:15:00 +0000"
string(30) "26 October 2014 01:15:00 +0100"
int(1414286100)
string(30) "26 October 2014 01:15:00 +0000"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-10-10 07:19 UTC] Octuro at gmail dot com
This particular date is during the BST to GMT switch over
 [2015-02-17 22:30 UTC] dev dot anubis at gmail dot com
Duplicate of #63442
 [2015-05-18 13:34 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2015-05-18 13:34 UTC] cmb@php.net
Indeed, a duplicate of bug #63442.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 00:01:28 2024 UTC