Bug 607453 - php mktime() is limited to 32-bit timestamps (1900-2038) on 64-bit systems
Summary: php mktime() is limited to 32-bit timestamps (1900-2038) on 64-bit systems
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: php
Version: 5.5
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Joe Orton
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
: 622597 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-24 06:35 UTC by Travers Carter
Modified: 2018-11-26 18:42 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-21 06:29:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0249 0 normal SHIPPED_LIVE php bug fix and enhancement update 2012-02-20 15:07:10 UTC

Description Travers Carter 2010-06-24 06:35:41 UTC
Description of problem:
PHP's mktime() function (and probably other date-time functions) is limited to the 32-bit timestamp range, even on 64-bit platforms (eg x86_64), this is a regression from php 4, where 64-bit timestamps were supported on 64-bit platforms.

The problem appears to be a missing "#include <limits.h>" in ext/date/lib/timelib.h, causing it to fall back on a hardcoded 32-bit definition of LONG_MAX.

This #include appears to have been added in PHP 5.2.6
http://svn.php.net/viewvc/php/php-src/tags/php_5_2_6/ext/date/lib/timelib.h?view=markup

See lines 25-27 of the above


Version-Release number of selected component (if applicable):
php-5.1.6-27.el5

How reproducible:
Always

Steps to Reproduce:
1. Run php -r 'var_dump(mktime(1, 1, 1, 1, 1, 2039));'
  
Actual results:
bool(false)

Expected results:
int(2177416861)

Additional info:

Comment 1 Joe Orton 2010-06-24 12:21:33 UTC
Thanks for the report, and for tracking down the problem.

Comment 3 RHEL Program Management 2010-08-09 19:13:48 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 6 Joe Orton 2011-12-16 15:01:04 UTC
*** Bug 622597 has been marked as a duplicate of this bug. ***

Comment 8 errata-xmlrpc 2012-02-21 06:29:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0249.html


Note You need to log in before you can comment on or make changes to this bug.