function format_time_ago(timeUploaded) {
	var thisdate = new Date();
	currentTime = thisdate.getTime();
	diffInMilliseconds = currentTime - timeUploaded;
    return formatOutput(diffInMilliseconds);
}


function formatOutput(timeDIffInMilliseconds) {
	var sec = Math.floor(timeDIffInMilliseconds/1000);
	var min = Math.floor(sec/60);
	var hr = Math.floor(min/60);
	var day = Math.floor(hr/24);
	var week = Math.floor(day/7);
	var month = Math.floor(day/30);
	var year = Math.floor(day/365);
	var pluralString = "s";
	min = min % 60;
	hr = hr % 24;
	if (year > 0)
	   {
	   return (year + " yıl önce");
	   }
	else if (month > 0)
	   {
	   return (month + " ay önce");
	   }

	else if (week > 0)
	   {
	   return (week + " hafta önce");

	   }
	else if (day > 0)
	   {
	   return (day + " gün önce");
	   } 
	else if (hr > 0)
	   {
	   return (hr + " saat önce");
	   } 
	else if (min > 0)
	   {
	   return (min + " dakika önce");
	   }         
	else
	   {
	   return ("1 dakika önce");
	   }

}