2012-04-26 116 views

回答

2

試試這個

$str = "Wed, 25 Apr 2012 23:17:06 -0400"; 
$date = date("Y-m-d",strtotime($str)); 
1

你的意思是:


$date = "Wed, 25 Apr 2012 23:17:06 -0400"; 
echo date("Y-m-d H:i:s", strtotime($date)); 
1
$date_val = 'Wed, 25 Apr 2012 23:17:06 -0400'; 
echo date('Y-m-d', strtotime($date_val)); 

你可以改變任何你想要的

0

我發現這個吼叫功能,我希望它會幫助全:

<?php 
    $str = "Wed, 25 Apr 2012 23:17:06 -0400"; 
    $myDate = strtotime($str); 
?> 
0

試試這個 $ dateSrc = 「星期三,2012年4月25日23時17分06秒-0400」; $ dateTime = new DateTime($ dateSrc);