关于PHP的DateAdd自定义函数问题!
function DateAdd ($interval, $number, $date) { $date_time_array = getdate($date);
$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"];
switch ($interval)
{
case "yyyy": $year +=$number; break;
case "q": $month +=($number*3); break;
case "m": $month +=$number; break;
case "y":
case "d":
case "w": $day+=$number; break;
case "ww": $day+=($number*7); break;
case "h": $hours+=$number; break;
case "n": $minutes+=$number; break; //分钟
case "s": $seconds+=$number; break;
}
$timestamp = mktime($hours ,$minutes, $seconds,$month ,$day, $year);
return $timestamp;
}
$date_QT="8:21:12"
$date_Ten=DateAdd ("n", 10, $date_QT);//获得签到时间往后加10分钟的时间
我想返回一个为“8:31:12”这个时间行不!
但是显示“608”不知道为什么。望大家指教!!