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中更改日期格式
来自类似 2012-12-14 08:40:26
格式化数字,如 28124629523
仅供参考,您要查找的内容称为Unix 时间戳
采用strtotime()
strtotime()
echo strtotime('2012-12-14 08:40:26');
或者DateTime
DateTime
$datetime = new DateTime('2012-12-14 08:40:26'); echo $datetime->getTimestamp();