更新时间:2023-10-27 17:41:16
更简便的方法.
$new_date = date('Y-m-d h:i:s', strtotime('2008-12-08 04:16:51 +'.rand(30, 60 * 60 * 24 * 3).' seconds'));
如何使用php生成一个随机时间间隔并将其添加到mysql datetime?