Mon Mar 12 10:18:26 +0800 2012 时间格式转换解决方法

WBOY
Release: 2016-06-13 10:15:13
Original
1539 people have browsed it

Mon Mar 12 10:18:26 +0800 2012 时间格式转换
上面的是个字符串,怎么把那个时间转换成2012-3-12 10:18:26格式 ,用php写的,谢谢啦

------解决方案--------------------
$s='Mon Mar 12 10:18:26 +0800 2012';
echo date('Y-m-d H:i:s',strtotime($s));
------解决方案--------------------
好像可以直接用date转吧,忘记了

$str='Mon Mar 12 10:18:26 +0800 2012';
echo date('Y-m-d G:i:s',strtotime($str));
------解决方案--------------------

探讨

$s='Mon Mar 12 10:18:26 +0800 2012';
echo date('Y-m-d H:i:s',strtotime($s));

------解决方案--------------------
探讨

好像可以直接用date转吧,忘记了

$str='Mon Mar 12 10:18:26 +0800 2012';
echo date('Y-m-d G:i:s',strtotime($str));
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!