$times = array - cannot retrieve seconds and minutes

Hi, so I’m using this part of code to show post time. I don’t know the reason but it shows yrs,months,weeks,days and hours only. I cannot get seconds and minutes to be readable by human. I use this in wordpress plugin where comment has a timestamp. Any ideas on solving this issue?

<?php
ob_start();
function last_comment_time(){
	global $post;
	$timestamp=get_post_meta($post->ID,"qya_last_post_posted",true);
	if($timestamp==""){
	echo "effekt yoxdur";
	}else{
	echo "sonuncu effekt".readable_time($timestamp,1)." ago";
	}
}
	function get_last_comment_time($extra=""){
		global $post;
		if($extra=="timestamp"){
			return get_post_meta($post->ID,"qya_last_post_posted",true);
		}else{
			$ytime=get_post_meta($post->ID,"qya_last_post_posted",true);
			return readable_time($ytime,1);
		}
	}	
	function get_post_start_time($extra=""){
	global $post;
		if($extra=="timestamp"){
			return strtotime($post->post_date);
		}else{
			$xtime=strtotime($post->post_date);
			return readable_time($xtime,1);
		}
	}
function readable_time($timestamp, $num_times = 2)
{
    //this returns human readable time when it was uploaded (array in seconds)
    $times = array(31536000 => 'il', 2592000 => 'ay',  604800 => 'h&#601;ft&#601;', 86400 => 'gün', 3600 => 'saat', 60 => 'd&#601;qiq&#601;', 1 => 'saniy&#601;');
    $now = time();
    $secs = $now - $timestamp;
    $count = 0;
    $time = '';

    foreach ($times AS $key => $value)
    {
        if ($secs >= $key)
        {
            //time found
            $s = '';
            $time .= floor($secs / $key);

            if ((floor($secs / $key) != 1))
                $s = '';
            $time .= ' ' . $value . $s;
            $count++;
            $secs = $secs % $key;

            if ($count > $num_times - 1 || $secs == 0)
                break;
            else
                $time .= ', ';
        }
    }
    return $time;
}
?>

function readable_time($timestamp) {
$formats = array('y','m','d','h','m','s');
$strval = array('years','months','days','hours','minutes','seconds');
$start = new DateTime(date('Y-m-d H:i:s',$stime);
$end = new DateTime(); //Now.
$diff = $start->diff($end);
foreach($formats AS $key => $format) {
  if($diff->format('%'.$format) != 0) {
   return $diff->format('%'.$format)." ".$strval[$key]." ago";
  }
}
return "Just now"; //0 seconds ago.
}

I dont know what I have done wrong, did not do the trick…

I found it to be a database problem, fixed with a new database

actually not! it must be wrong coding since when I change time zone from UTC and time format from g:i a, it turns out that it does not return seconds and minutes. why??