如何将php m.d.Y日期转换为Unix时间戳?

如何将php m.d.Y日期转换为Unix时间戳?,php,strtotime,Php,Strtotime,我收到的日期大约是2012年11月30日,我需要将其转换为UNIX时间戳,但在PHP中,它似乎不起作用。我怎样才能解决这个问题。提前谢谢 试试这个 $date = "11.30.2012"; $x = explode(".",$date); $req_date = $x[2]."-".$x[0]."-".$x[1]; $unixdate = strtotime($req_date); $date = "11.30.2012"; list($month, $day, $year) = s

我收到的日期大约是2012年11月30日,我需要将其转换为UNIX时间戳,但在PHP中,它似乎不起作用。我怎样才能解决这个问题。提前谢谢

试试这个

$date = "11.30.2012";

$x = explode(".",$date);

$req_date = $x[2]."-".$x[0]."-".$x[1];

$unixdate = strtotime($req_date);
$date = "11.30.2012"; 
list($month, $day, $year) = split('.', $date); 
$timeStamp = mktime(0, 0, 0, $month, $day, $year);
试试这个

$date = "11.30.2012";

$x = explode(".",$date);

$req_date = $x[2]."-".$x[0]."-".$x[1];

$unixdate = strtotime($req_date);
$date = "11.30.2012"; 
list($month, $day, $year) = split('.', $date); 
$timeStamp = mktime(0, 0, 0, $month, $day, $year);

我刚想出来。因为它是无效的日期格式,所以我必须用“/”或任何其他有效的日期符号替换“.”$日期=“11.30.2012”;echo str_替换(“.”,“/”,$date);