2015-08-20 56 views

回答

1

你可以這樣做:

$str = "Tue Aug 18 2015 07:20:00 GMT 0530 (IST)"; 
// remove the part after GMT 
$str = substr($str,0,-11); 
// create date from string 
$date = date_create($str); 
// IST (Indian Standard Time) = Asia/Kolkata 
$zone = new DateTimeZone('Asia/Kolkata'); 
// set timezone 
date_timezone_set($date,$zone); 
// output formatted date 
$vcal = $date->format("Ymd\THis\Z"); 
echo $vcal; 

輸出是:

20150818T125000Z 
+0

感謝您的簡短回答 –

相關問題