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

格式化时间有关问题

WBOY
Release: 2016-06-13 12:54:04
Original
920 people have browsed it

格式化时间问题
如果输入格式是  2010-11-23 02:10  想输入为 2010-11-23 02:10:00
如果输入格式是  2010-11-23   想输入为 2010-11-23 00:00:00

有类似的函数么?


------解决方案--------------------
<br />
$stime = '2010-11-23 02:10 ';<br />
echo date('Y-m-d H:i:s',strtotime($stime));<br />
<br />
echo "<br/>";<br />
$dtime = '2010-11-23';<br />
echo date('Y-m-d 00:00:00',strtotime($dtime));<br />
Copy after login
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