matn89 Posted March 16, 2013 Share Posted March 16, 2013 Hi all. I am grabbing two time stamps from a mysql db and storing them in variables, the timestamps are stored in the format YY-MM-DD HH:MM:SS . Could anyone tell me how I might go about comparing two timestamps that are in this format, I need to check if one is older than the other. Thank you for your time. Quote Link to comment https://forums.phpfreaks.com/topic/275744-compare-time-stamps/ Share on other sites More sharing options...
Barand Posted March 17, 2013 Share Posted March 17, 2013 if ($a < $b) echo "$a is older"; Quote Link to comment https://forums.phpfreaks.com/topic/275744-compare-time-stamps/#findComment-1419077 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.