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

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

WBOY
Release: 2016-06-13 12:55:36
Original
831 people have browsed it

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

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

 

输出:

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

为嘛两次不一样啊

要崩溃了。。。求解


------解决方案--------------------
echo date ( 'Y-m-d',strtotime($newsList[0][date]));
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template