php compare two dates
$today = date("Y-m-d");
$expire = $row->expireDate; //from database
$today_time = strtotime($today);
$expire_time = strtotime($expire);
if ($expire_time < $today_time) { /* do Something */ }
php compare two dates
$today = date("Y-m-d");
$expire = $row->expireDate; //from database
$today_time = strtotime($today);
$expire_time = strtotime($expire);
if ($expire_time < $today_time) { /* do Something */ }
compare dates datetime php
$date1 = new DateTime("now");
$date2 = new DateTime("tomorrow");
var_dump($date1 == $date2); // false
var_dump($date1 < $date2); // true
var_dump($date1 > $date2); // false
date comparison function in php
Select if(Date('2020-10-01') > Date('2020-11-01'), '1', '2' ) as rslt_date
php compare dates
$date1 = "2021-01-15";
$date2 = "2021-01-18";
if ($date1 < $date2) {
echo "$date1 is earlier than $date2";
} else {
echo "$date1 is later than $date2";
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us