Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
任何人都可以帮助我使用 php 以获取以下格式的当前时间戳。
2013-05-11 18:00:00
我目前的尝试如下:
$todaysDate = date('Y-m-d\h:i:s', strtotime('+0 day',time()));
正在输出:
2013-05-03h:24:16
Try this formatting:
date("Y-m-d H:i:s");
Default value of the date function is current date and time
如果您尝试不使用反斜杠,结果是什么?
$todaysDate = date('Y-m-d h:i:s', strtotime('+0 day',time()));