如何将此2014-11-03 17:01:37转换为Unix时间戳? 有没有我可以使用的方法。
答案 0 :(得分:0)
使用 - strtotime()
$date = "2014-11-03 17:01:37";
echo strtotime($date);
答案 1 :(得分:0)
strtotime('2014-11-03 17:01:37')
答案 2 :(得分:0)
您可以创建DateTime
对象:
$time = new DateTime("2014-11-03 17:01:37");
$time->getTimestamp();
答案 3 :(得分:0)
PHP为此目的有一个function strtotime
。
echo strtotime("2014-11-03 17:01:37");