Bug #74374 [NEW]: DateTime::sub dosnt work
| From: | dualsword at mail dot ru | Date: | Wed, 05 Apr 2017 11:16:37 +0000 |
| Subject: | Bug #74374 [NEW]: DateTime::sub dosnt work | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-208331@lists.php.net to get a copy of this message | ||
From: dualsword at mail dot ru
Operating system: ubuntu 16.04 Desktop
PHP version: 7.1.3
Package: Date/time related
Bug Type: Bug
Bug description:DateTime::sub dosnt work
Description:
------------
---
Its work with date '2011-03-27 03:59:59'
---
Test script:
---------------
$d = new DateTime('2011-03-27 03:59:59');
var_dump(['$d is' => $d]);
$d_new = $d->sub(new DateInterval('PT1H'));
var_dump(['$d_new is' => $d_new]);
Expected result:
----------------
array (size=1)
'$d_new is' =>
object(DateTime)[1]
public 'date' => string '2011-03-27 02:59:59.000000' (length=26)
public 'timezone_type' => int 3
public 'timezone' => string 'Europe/Moscow' (length=13)
Actual result:
--------------
array (size=1)
'$d_new is' =>
object(DateTime)[1]
public 'date' => string '2011-03-27 03:59:59.000000' (length=26)
public 'timezone_type' => int 3
public 'timezone' => string 'Europe/Moscow' (length=13)
--
Edit bug report at https://bugs.php.net/bug.php?id=74374&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74374&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74374&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74374&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74374&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74374&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74374&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74374&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74374&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74374&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74374&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74374&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74374&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74374&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74374&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74374&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74374&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74374&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74374&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74374&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74374&r=mysqlcfg