【发布时间】:2015-12-27 09:24:01
【问题描述】:
一个错误:
警告:date() 期望参数 2 很长
这是一个回发 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 类型。 “long”数据类型是一个数字,没有任何其他字符,例如 unix 时间戳是一个 long 数据类型。 $mysql['click_time'] 的值是多少?
标签: php date postback autopostback postbackurl