php时间戳

WBOY
WBOYOriginal
2016-06-23 13:06:051153browse

        $time = strtotime(date('Y-m-d'));
        echo date('y-m-d h:i:s', $time);

为什么打出来
        16-05-17 12:00:00
        不应该是16-05-17 00:00:00


回复讨论(解决方案)

echo date('y-m-d  H:i:s', $time);

h 12 小时格式,有前导零 01 到 12 

当前时间:
echo date("Y-m-d H:i:s",time())

echo date('y-m-d  H:i:s', $time);

 

要这么逗比不?原因是?小写代表12小时制

拜托你看看手册

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