2011-02-25 90 views

回答

1

您可以使用strtotime

date('d-m-Y H:i:s', strtotime('+1 hour')); // one hour since now 

date('d-m-Y H:i:s', strtotime('2011-02-25 14:00:42')); 
1
$mydate = date("dateformat", time() + 43200); 

時間()獲取當前時間戳,那麼你加43200這就是12小時* 60分鐘* 60秒

2
$now = time(); 
$then = $now + 12 * 60 * 60; 
echo date(format, $then); 
相關問題