Bug #74930 [Opn->Nab]: when $timestamp > 1500367000, strtotime($timestamp) won't return false
| From: | requinix@php.net | Date: | Sat, 15 Jul 2017 17:36:10 +0000 |
| Subject: | Bug #74930 [Opn->Nab]: when $timestamp > 1500367000, strtotime($timestamp) won't return false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210070@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74930&edit=1
ID: 74930
Updated by: requinix@php.net
Reported by: yaozeyuan93 at gmail dot com
Summary: when $timestamp > 1500367000, strtotime($timestamp)
won't return false
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: Any
PHP Version: 5.6.31
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Because that number looks like HHMMSSYYYY format.
http://php.net/manual/en/datetime.formats.php
strtotime has to assume that what you pass is supposed to be a date/time string of some sorts.
Garbage in, garbage out.
Previous Comments:
------------------------------------------------------------------------
[2017-07-15 17:29:20] yaozeyuan93 at gmail dot com
Description:
------------
according to
[document](http://php.net/manual/en/function.strtotime.php#refsect1-function.strtotime-changelog),
put number into strtotime will be ignore and return false. But if the number > 1500367000,
strtotime will return a big number but not false instead
Test script:
---------------
<?php
$timestamp = 1500367000; // result by strtotime('2017-7-18 16:36:40'),larger will also had
this problem
echo strtotime($timestamp); // while return 158748447636, not false
Actual result:
--------------
158748447636
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74930&edit=1