PHP date comparison

后端 未结 9 501
长情又很酷
长情又很酷 2021-02-02 16:10

How would I check if a date in the format \"2008-02-16 12:59:57\" is less than 24 hours ago?

9条回答
  •  醉梦人生
    2021-02-02 16:39

    Just use it.....

    if(strtotime($date_start) >= strtotime($currentDate))
    {
    // Your code
    }
    

提交回复
热议问题