// 将目前的时间戳值放入一数组内
$strdate = '2014-02-03';
$desDate = strtotime($strdate);
//var_dump($desDate);
$timestamp = time();
//echo "
originalDate:".date('Y-m-d',time())."
";
echo "
originalDate:".date('Y-m-d',$desDate)."
";
//$date_time_array = getdate($timestamp);
$date_time_array = getdate($desDate);
$hours = $date_time_array["hours"];
$minutes = $date_time_array["minutes"];
$seconds = $date_time_array["seconds"];
$month = $date_time_array["mon"];
$day = $date_time_array["mday"];
$year = $date_time_array["year"];
// 用mktime()函数重新产生Unix时间戳值减7天
$timestamp = mktime($hours, $minutes, $seconds, $month, $day-7, $year);
echo "
addSevenDate:".date('Y-m-d',$timestamp)."
";
echo "
------
";
$yestertime = date ( 'Y-m-d', strtotime("-7 day",$desDate) );
echo "maethod2:".$yestertime;