📜  如何在 php datetime 中添加小时分钟秒 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:15.798000             🧑  作者: Mango

代码示例3
$minutes_to_add = 5;

$time = new DateTime('2011-11-17 05:05');
$time->add(new DateInterval('PT' . $minutes_to_add . 'M'));

$stamp = $time->format('Y-m-d H:i');