This will help....
function get_time($date,$nosuffix=''){
$datetime = new DateTime($date);
$interval = date_create('now')->diff( $datetime );
if(empty($nosuffix))$suffix = ( $interval->invert ? ' ago' : '' );
else $suffix='';
//return $interval->y;
if($interval->y >=1) {$count = date(VDATE, strtotime($date)); $text = '';}
elseif($interval->m >=1) {$count = date('M d', strtotime($date)); $text = '';}
elseif($interval->d >=1) {$count = $interval->d; $text = 'day';}
elseif($interval->h >=1) {$count = $interval->h; $text = 'hour';}
elseif($interval->i >=1) {$count = $interval->i; $text = 'minute';}
elseif($interval->s ==0) {$count = 'Just Now'; $text = '';}
else {$count = $interval->s; $text = 'second';}
if(empty($text)) return '<i class="fa fa-clock-o"></i> '.$count;
return '<i class="fa fa-clock-o"></i> '.$count.(($count ==1)?(" $text"):(" ${text}s")).' '.$suffix;
}