strtotime doesn't support 64 bit timestamps

Bug #194318 reported by Guillermo Pérez
4
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: php5

PHP bug http://bugs.php.net/bug.php?id=44209 is affecting latest feisty/hardy php packages (5.2.1/5.2.4-2ubuntu4). Now they have fixed it in CVS. Is possible to get this fixed in ubuntu's PHP packages? At least for next hardy. Thx a lot

Description:
------------
strtotime() of years >2038 or <1900 does not work on 64 bit platforms,
that should not have problems with those dates. The rest of php
functions work properly with those extended dates.

Reproduce code:
---------------
On 64 bit platforms php date functions support greater range of dates.
For exampe:

<?= date('d-m-Y',time()+31536000000) ?>
Returns:
3007-06-25

But strtotime does not work with those improved date ranges:

<?= date('Y-m-d',strtotime('3007-06-25')) ?>
Returns:
1970-01-01

I understand that output on 32 bit platforms, but on 64 bit should work
as the rest of functions, and return a valid 64bit timestamp for dates
>2038 or <1900.

Related branches

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hi-

I grabbed the patch from PHP upstream from http://marc.info/?l=php-cvs&m=120367371119481&w=2 and built a new php5 package for Hardy.

However, there were several regression tests in the PHP suite which failed. See the differences: http://pastebin.com/pastebin.php?diff=f768e161f

I opened a new bug with PHP: http://bugs.php.net/bug.php?id=44219

I'd like to get these test regressions sorted out before updating Hardy's php5.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Updated php5 with the upstream 64-bit time fixes, as well as the associated automated tests.

Tested, no regressions.

Attached debdiff for Hardy inclusion.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package php5 - 5.2.4-2ubuntu5

---------------
php5 (5.2.4-2ubuntu5) hardy; urgency=low

  * fixes strtotime support for 64 bit timestamps (LP: #194318)
    - Upstream: http://bugs.php.net/bug.php?id=44209
  * Update tests to account for newly working timestamps
    - Upstream: http://bugs.php.net/?id=44219

 -- Dustin Kirkland <email address hidden> Wed, 27 Feb 2008 13:00:18 -0500

Changed in php5:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.