Bug #15478 [Com]: BC break - new Date(time()) doesn't work
| From: | flintweather@gmail.com | Date: | Tue, 18 Sep 2018 21:24:50 +0000 |
| Subject: | Bug #15478 [Com]: BC break - new Date(time()) doesn't work | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-11429@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=15478&edit=1
ID: 15478
Comment by: flintweather at gmail dot com
Reported By: daniel dot oconnor at gmail dot com
Summary: BC break - new Date(time()) doesn't work
Status: Duplicate
Type: Bug
Package: Date
Package Version: CVS
PHP Version: 5.2.6
Roadmap Versions:
New Comment:
Bug #14413 patched.
Previous Comments:
------------------------------------------------------------------------
[2009-01-01 03:49:02] doconnor
Bug #14413
------------------------------------------------------------------------
[2009-01-01 03:45:54] gauthierm
This is a dupe of Bug #14413.
------------------------------------------------------------------------
[2009-01-01 03:42:18] doconnor
Test:
<?php
require_once 'Date.php';
$d = new Date(strtotime("2009-01-01 0:00:00"));
print date("Y-m-d H:i:s", $d->getTime());
Expected:
2009-01-01 0:00:00
Actual:
1999-11-30 01:00:00
------------------------------------------------------------------------
[2009-01-01 03:37:31] doconnor
Description:
------------
Its no longer possible to create a new Date() and pass in a timestamp.
Instead, setFromTime() must be used.
This is a BC break from 1.4.X
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=15478&edit=1