我有一个DB字段(pickup_time)与(varchar) 结果就像这样= 01:55:AM 而且我想用php比较当前的时间,所以在pickup_time 30分钟之前,我想显示一个按钮。 请帮助我,我被困(Codeigniter)。
$trp_time=$row->pickup_time;
$time_now=date('h:i A',$trp_time);
$res=strtotime('h:i A',$trp_time);
$diff= round(abs($time_now-$res)/60,2);
The above code is not worked for me.
Before 30 minutes of pickup time i want a button is to be get eanble.