|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-11-17 17:41 UTC] fsb at thefsb dot org
Description:
------------
strtotime('0000-00-00') returns int(-62169955200) in a script run by
apache web server and bool(false) when run by the command line.
Reproduce code:
---------------
<?php
var_dump(strtotime('0000-00-00'));
?>
this script outputs int(-62169955200) to the web browser when run as a web page and bool(false) when run on the command line.
Expected result:
----------------
i would expect the same result from running the function in the two
contexts.
regarding which result strtotime('0000-00-00') should return, i don't
know. both answers seem reasonable to me. it would help if php
documentation would specify the range of dates and unix timestamps that
date and time functions can handle.
Actual result:
--------------
int(-62169955200) in the web page
bool(false) in the command line
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 14:00:01 2025 UTC |
i was wrong with the expected results. a year of 0000 is reasonable but neither month = 00 nor day of of the month = 00 are possible, so the strtotime('0000-00-00') should return bool(false)