Skip to main content
 首页 » 编程设计

php 日期时间运算比较

2022年07月19日164小虾米

    $sql= "select * from t_datestudy where id='4750' and agreemode='2' and school_agree !='1'";       
    $result = mysql_query($sql,$connection);
    $app = mysql_fetch_array($result);
    mysql_free_result($result);
    $dt1 = $app['CDATE'] . ' ' . $app['START_TIME'] ;
    $dt2 = date('Y-m-d H:i:s',strtotime('+2 Hour'));
    if ($dt2 > $dt1)
        echo "exceed";
    else
        echo "ok";


本文参考链接:https://www.cnblogs.com/xihong2014/p/5544975.html