Bug #68204 [NEW]: getTimeStamp alters actual time stamp
| From: | Octuro at gmail dot com | Date: | Fri, 10 Oct 2014 07:09:21 +0000 |
| Subject: | Bug #68204 [NEW]: getTimeStamp alters actual time stamp | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187996@lists.php.net to get a copy of this message | ||
From: Octuro at gmail dot com
Operating system: Ubuntu14.04
PHP version: 5.5.17
Package: Date/time related
Bug Type: Bug
Bug description:getTimeStamp alters actual time stamp
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"
--
Edit bug report at https://bugs.php.net/bug.php?id=68204&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68204&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68204&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68204&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68204&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68204&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68204&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68204&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68204&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68204&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68204&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68204&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68204&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68204&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68204&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68204&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68204&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68204&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68204&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68204&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68204&r=mysqlcfg