2017-04-20 133 views
0

我需要加入日期字段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>"; 
?> 
+0

并不清楚你的问题。你想连接“(strtotime($ bid_schedule_date)+ strtotime($ bid_schedule_time))”这行吗? –

+0

将日期和时间作为单个实体存储 – Strawberry

+0

2017-04-22 | 11:56:00 | 00:30:00 –

回答

0
+0

尽管这个链接可能回答这个问题,但最好在这里包含答案的基本部分,并提供参考链接。如果链接页面更改,则仅链接答案可能会失效。 - [来自评论](/ review/low-quality-posts/16270522) – user1438038

+0

对不起,这是哪个链接? –

相关问题