【发布时间】:2017-04-20 05:08:46
【问题描述】:
我需要加入日期字段bid_staring_date 和时间字段bid_staring_time 并检查当前日期时间$current_date_time=date('M d,Y H:i:s'); 我该怎么做?
<?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))”连接起来?
-
将日期和时间存储为单个实体
-
2017-04-22 | 11:56:00 | 00:30:00