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

格式化时间有关问题

WBOY
WBOYOriginal
2016-06-13 12:54:04865browse

格式化时间问题
如果输入格式是  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 />
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