我想傳遞一些date to timestamp
,日期formart是%day %month %time
。像25 nov 07:44
一樣,我嘗試了下面的一些方法,但是這兩個日期是不同的。需要幫助,謝謝。
<?php
$date = '25 nov 07:44';
$time = explode(" ",$date);
$minute = explode(":",$time[2]);
$timestamp = mktime(''.$minute[0].' '.$minute[1].' 00 '.$time[1].' '.$time[0].' 2011')."<br />";// mktime(%hour, %minute, %second, %month, %day, %year);
echo $timestamp; //1322202671
echo date("Y-m-j H:i:s", $timestamp); //2011-11-25 07:31:11
?>
你試過['的strtotime()'](http://php.net/manual/en/function.strtotime.php )? –