我需要加入日期字段bid_staring_date
,时间字段为bid_staring_time
,并检查当前日期时间$current_date_time=date('M d,Y H:i:s');
我该怎么做?如何加入在时间字段中提交的日期php
<?php
$current_date_time=date('M d,Y H:i:s');
$bid_schedule_date=date('M d,Y',strtotime($row['bid_staring_date']));
$bid_schedule_time=date('H:i:s',strtotime($row['bid_staring_time']));
echo $bid_schedule_date_time=date('M d,Y H:i:s',(strtotime($bid_schedule_date)+strtotime($bid_schedule_time)));
$bid_schedule_id=$row['bid_schedule_id'];
if($current_date_time>=$bid_schedule_date_time){
$btn_type="btn btn-success";
$btn_value="Bid Now";
$btn_link="openbid.php?pid=$bid_schedule_id";
}
else
{
$btn_type="btn btn-danger";
$btn_value="Bid Not Started";
$btn_link="#";
}
echo "<a href='$btn_link' class='$btn_type'>$btn_value</a>";
?>
并不清楚你的问题。你想连接“(strtotime($ bid_schedule_date)+ strtotime($ bid_schedule_time))”这行吗? –
将日期和时间作为单个实体存储 – Strawberry
2017-04-22 | 11:56:00 | 00:30:00 –