php - Number of days between two time stamps -
how can calculate number of days between 2 times, have 1 time field in table name active_time
, following code have tried gives me number value around thousands whereas have queried number of days:
$now =strtotime("now"); // current time $your_date = $data[$i]['active_time']; $datediff = $now - $your_date; $value= floor($datediff/(60*60*24));
result:16569
try: $value= ceil(abs($now - $your_date) / 86400);
Comments
Post a Comment