Home >Backend Development >PHP Tutorial > php时间格式化有关问题 求解

php时间格式化有关问题 求解

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:55:36835browse

php时间格式化问题 求解
代码:

echo '<br/>';<br />
 echo $newsList [0] [date] ; <br />
 echo '<br/>';<br />
 echo date ( 'Y-m-d',$newsList[0][date]);<br />

 

输出:

2012-10-18 09:27:31
1970-01-01

为嘛两次不一样啊

要崩溃了。。。求解


------解决方案--------------------
echo date ( 'Y-m-d',strtotime($newsList[0][date]));
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn