PHP
(simple examples)
PARSE INTO DATE-TIME OBJECTS $dtA = new DateTime("2019-08-07"); $dtB = new DateTime("2017-08-09");
COMPARE DATES if ($dtA > $dtB) { echo "A is later"; } else if ($dtA < $dtB) { echo "B is later"; } else { echo "AB are the same"; }
PARSE INTO UNIX TIMESTAMPS $dtA = strtotime("2019-08-07"); $dtB = strtotime("2017-08-09");
COMPARE DATES if ($dtA > $dtB) { echo "A is later"; } else if ($dtA < $dtB) { echo "B is later"; } else { echo "AB are the same"; }
DATE MUST BE IN YYYY-MM-DD $dtA = "2019-08-07"; $dtB = "2019-10-11";
COMPARE DATES if ($dtA > $dtB) { echo "A is later"; } else if ($dtA < $dtB) { echo "B is later"; } else { echo "AB are the same"; }