[PEAR-BUG] Bug #15478 [Com]: BC break - new Date(time()) doesn't work

[email protected] ("[email protected]") Tue, 18 Sep 2018 17:24:50 -0400 (EDT)
Newsgroups php.pear.bugs
Message-ID <[email protected]>
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