有幾種替代方案可以獲取當前時間:
$current_time = date('Y-m-d H:i:s');
$current_time = date('Y-m-d H:i:s', time());
$current_time = (new DateTime())->format('Y-m-d H:i:s');
這些替代方案都可以獲取當前時間,可以根據實際需求選擇合適的方法。