NickName:Aaron Ask DateTime:2011-09-17T22:17:40 Comparing timestamps in PHP How would I be able to return a boolean expression of true once exactly 24 hours have passed and no more? I am using strtotime() to out put these two times: $time1 = 1316268919; $time2 = 1316268898; Copyright Notice:Content Author:「Aaron」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.Link to original article:https://stackoverflow.com/questions/7455411/comparing-timestamps-in-php Answers EdoDodo 2011-09-17T14:20:46 This should do what you need:\n\nif (($time1-$time2) == 86400) {\n // Exactly 24 hours have passed.\n}\n", Oliver Charlesworth 2011-09-17T14:20:01 strtotime() returns the number of seconds since the Unix epoch. So to find the difference in times, simply subtract one from another. Then compare that difference against the number of seconds in 24 hours (24 * 60 * 60).", goto-bus-stop 2011-09-17T14:22:41 abs($time1 - $time2) === 60 * 60 * 24\n\n\nthe abs is just in case; time2 might be bigger than time1.\n\nIf the difference in times equals 60 (seconds in a minute) * 60 * (minutes per hour) * 24 (hours for a day) = 86400, there's a day difference",