2014-11-05 230 views
-1

喲如何將這個2014-11-03 17:01:37轉換爲Unix時間戳? 有沒有我可以使用的方法。PHP日期轉換爲unix時間戳

+0

['strptime'](http://www.php.net/manual/en/function.strptime.php) – 2014-11-05 10:07:00

回答

0

您可以創建一個DateTime對象:

$time = new DateTime("2014-11-03 17:01:37"); 
$time->getTimestamp(); 
0

使用 - strtotime()

$date = "2014-11-03 17:01:37"; 
echo strtotime($date); 
0
strtotime('2014-11-03 17:01:37') 
0

PHP具有實現這一目的的function strtotime

echo strtotime("2014-11-03 17:01:37"); 
相關問題