<?php   
		
		function get_date_difer($posted_date)
		{
			
			$current_date =  date("Y-m-d H:i:s");    
			$seconds = strtotime($current_date) - strtotime($posted_date);

			$days    = floor($seconds / 86400);
			$hours   = floor(($seconds - ($days * 86400)) / 3600);
			$minutes = floor(($seconds - ($days * 86400) - ($hours * 3600))/60);
			$seconds = floor(($seconds - ($days * 86400) - ($hours * 3600) - ($minutes*60)));
			
			 
			
			   
 
			if($hours < 1 &&  $hours <1 && $days < 1)
				$msg  =  $minutes." minutes ago "; 
			else if($hours < 10 && $hours > 1 && $days < 1 )
				$msg  = $hours." Hours and ".$minutes."m ago ";
			else if($hours > 10 && $days < 1 && $days < 1)
				$msg  = "Today" ;  
			else if($days > 0  && $days < 2)
				$msg  = "Yesterday" ;     
			else  if($days ==2)
				$msg  = "2 day and ".$hours." hours ago ";
			else  if($days ==3)
				$msg  = "3 day and ".$hours." hours ago ";
			else  if($days ==4)
				$msg  = "4 day and ".$hours." hours ago ";
			else   if($days ==5)
				$msg  = "5 day and ".$hours." hours ago ";
			else  
			{	 
				$old_date = $posted_date;
				$old_date_timestamp = strtotime($old_date);
				$new_date =  date('d-M-Y', $old_date_timestamp);  
				$msg  =  $new_date;
			}    
  			
			return $msg; 
		}  
		
?>