-1
Warning: date() expects parameter 2 to be long
這是一個回發PHP腳本的一部分,
$conv_time = time();
$click_time_to_date = new DateTime(date('Y-m-d h:i:s', $mysql['click_time']));
$conv_time_to_date = new DateTime(date('Y-m-d h:i:s', $conv_time));
$diff = $click_time_to_date->diff($conv_time_to_date);
$mysql['time_difference'] = $db->real_escape_string($diff->d.' days, '.$diff->h.' hours, '.$diff->i.' min and '.$diff->s.' sec');
$mysql['conv_time'] = $db->real_escape_string($conv_time);
$mysql['ip'] = $db->real_escape_string($_SERVER['HTTP_X_FORWARDED_FOR']);
$mysql['user_agent'] = $db->real_escape_string($_SERVER['HTTP_USER_AGENT']);
您在date()函數中使用的數據類型不是long類型。 「長」數據類型是一個數字,沒有任何其他字符,例如unix時間戳是一個長數據類型。 $ mysql ['click_time']的價值是什麼? – Santy