How can I check if the date is later than the current date?
if(date("d") < "18" && date("m") < "01") {
echo 'To late!';
}
Doesn't work for me.
How can I check if the date is later than the current date?
if(date("d") < "18" && date("m") < "01") {
echo 'To late!';
}
Doesn't work for me.
You can do this notation:
if( '20140505' > date("Ymd") ) {
// today's date is before 20140505 (May 5, 2014)
}
$time1 = strtotime(date("d/m/Y", "18/01/2014"));
if(time() > $time1)
{
echo "too late!";
}
The best is to use strtotime.
$current_date = date("Y-m-d");
$date_to_compare = date("Y-m-d",time()+86400); //1 day later
if (strtotime($date_to_compare) > strtotime($current_date)) {
echo "too late";
}