i tried most of what is available on stack overflow but none seem to work.
any way i am trying to compare two (date and time formats). and calculate whether their difference is within 5 seconds of each other
the first date is the current date:
$today = date("Y-m-d H:i:s");
the second date is taken from mysql database:
$result = mysql_query("SELECT * FROM BUS_DATA where BusRegID = 'bus'") or die(mysql_error());
$row = mysql_fetch_array($result);
$update_date = $row["update_date"];
the answer should be segmented into years , month , days , hours , minutes ,and seconds portions.
I am running PHP Version 5.3.3
Edit: most answers give result in time frame only , I want to check whether the date matches , then compare if the time of the day is within 5 seconds , than you guys in advance :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…