PHP Checking if the current date is before or after a set date

前端 未结 10 644
无人共我
无人共我 2021-02-01 13:10

Im pulling a date from a database which is formatted like dd-mm-YYYY.

What I want to do is check the current date;

  • if the current date is before the date com
10条回答
  •  借酒劲吻你
    2021-02-01 13:39

    I have used this one and it served the purpose:

    if($date < date("Y-m-d") ) {
                    echo "Date is in the past";}
    

    BR

提交回复
热议问题