Bug 607453

Summary: php mktime() is limited to 32-bit timestamps (1900-2038) on 64-bit systems
Product: Red Hat Enterprise Linux 5 Reporter: Travers Carter <tcarter>
Component: phpAssignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: ctatman, dkutalek, icarolan27
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 06:29:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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