I have this code to get the difference between two timestamps one in the past and one is NOW and i want to have the difference in seconds and minutes and hours and days but i get a wrong values each time . I need to know if I am dividing on right values:
<?php
$timestamp = '2013-11-16 16:26:30';
$post_date = strtotime($timestamp);
//echo $post_date;echo '</br>';
date_default_timezone_set('Asia/Istanbul');
$now = new DateTime();
$now_date = $now->getTimestamp();
//echo $now_date;
$timediff = $now_date - $post_date;
echo floor($timediff/1000);echo' Seconds';
echo floor($timediff/60);echo' Minutes';
echo floor(($timediff/60)/60);echo' Hours';
echo floor(((($timediff/60)/60)/24));echo' Days';
?>