$a = time();//获取当前时间戳
$b = strtotime("+7days", $a);//获取在以$a时间戳为基础的七天后的时间戳
//注意,以上获取的都是时间戳,strtotime()也要用时间戳,若想转转为阁下下用的那种显示方式,应该再用date函数转换
echo date("Y-m-d", $a);
echo "</br>";
echo date("Y-m-d", $b);
原来的时间加上天数
原来的时间加上分钟数
$a = time();//获取当前时间戳
$b = strtotime("+20 minute", $a);//获取在以$a时间戳为基础的20分钟后的时间戳
//注意,以上获取的都是时间戳,strtotime()也要用时间戳,若想转转为阁下下用的那种显示方式,应该再用date函数转换
echo date("Y-m-d H:i:s", $a);
echo "</br>";
echo date("Y-m-d H:i:s", $b);