ID:          37281
 Updated by:  [EMAIL PROTECTED]
 Reported By: kprice at gmail dot com
 Status:      Open
 Bug Type:    Documentation problem
 PHP Version: Irrelevant
 New Comment:

php -r '$a = new DateTime("1/1/1901"); echo $a->format("U");'
-2177456400

However, you do have a point. I think we even break to 32bit ints on 64
bit systems. I can check that when somebody grants me access to a 64bit
machine.


Previous Comments:
------------------------------------------------------------------------

[2006-11-11 03:11:45] lucas at facebook dot com

Derick, is this true even on 64bit systems? We've run into this problem
using mktime and strtotime on 5.2. For example:

mktime(0,0,0,1,1,1901) returns false
strtotime("1/1/1901") returns false

However 

date('r', -2178099690) returns:
Mon, 24 Dec 1900 04:18:30 -0800

I have not figured out how to return the timestamp from a DateTime
object created with the string "1/1/1901".

------------------------------------------------------------------------

[2006-05-03 11:25:25] [EMAIL PROTECTED]

It's a documentation problem. Although *internally* the new code does
support larger numbers it still can not return larger integers back to
user land. So for calling PHP functions the result can never be outside
this range.

However, the new date code which is going to make it into PHP 5.2 is
going to provide functions to deal with this correctly.

------------------------------------------------------------------------

[2006-05-02 19:11:37] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the
report.

Please also tell what your system is.

------------------------------------------------------------------------

[2006-05-02 18:39:10] kprice at gmail dot com

Description:
------------
The documentation claims: "On systems where time_t is a 32bit signed
integer, as most common today, the valid range for year is somewhere
between 1901 and 2038, although this limitation is overcome as of PHP
5.1.0."

However, based on my testing this is not the case. mktime still returns
FALSE for dates outside of this range.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37281&edit=1

Reply via email to