Bug #70691 [Opn->Nab]: strtotime to timestamp issue
| From: | requinix@php.net | Date: | Mon, 12 Oct 2015 03:29:44 +0000 |
| Subject: | Bug #70691 [Opn->Nab]: strtotime to timestamp issue | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-196539@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70691&edit=1
ID: 70691
Updated by: requinix@php.net
Reported by: fengzbao at qq dot com
Summary: strtotime to timestamp issue
-Status: Open
+Status: Not a bug
Type: Bug
-Package: *Database Functions
+Package: Date/time related
Operating System: centos 6.5 32
PHP Version: 5.4.45
Block user comment: N
Private report: N
New Comment:
It's a lot more obvious what is happening if you output the full date and time.
https://3v4l.org/TTj3g
And as you can see, your "solution" is very much incorrect.
Previous Comments:
------------------------------------------------------------------------
[2015-10-12 03:06:43] fengzbao at qq dot com
add os information
------------------------------------------------------------------------
[2015-10-12 03:05:36] fengzbao at qq dot com
Description:
------------
strtotime transfet string to timestamp issue some problem.
echo date('Y-m-d', strtotime('151011'));
we see:
2015-10-12
this is wrong.
and you can solve this case like this:
echo date('Y-m-d', '20' . strtotime('151011'));
Test script:
---------------
echo date('Y-m-d', strtotime('151011'));
Expected result:
----------------
2015-10-12
Actual result:
--------------
2015-10-11
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70691&edit=1