2014-01-20 205 views

回答

0

如何使用DateTime

<?php 
$date = new DateTime('2000-01-01'); 
$date->add(new DateInterval('P7D')); 
echo $date->format('Y-m-d') . "\n"; 
?> 
0

簡單的例子:

$dt = new DateTime('+7 days'); 
echo $dt->format('Y-m-d');