Have an account? Sign in
Login  Register  Facebook
This Page is Under Construction! - If You Want To Help Please Send your CV - Advanced Web Core (BETA)
[Edit] date in hours, days, months format

example of usage

echo timeBetween(1273222838,time());
function timeBetween($start,$end){
	$time = $end - $start;

	if($time <= 60){
		return 'one monent ago';
	}
	if(60 < $time && $time <= 3600){
		return round($time/60,0).' minutes';
	}
	if(3600 < $time && $time <= 86400){
		return round($time/3600,0).' hours';
	}
	if(86400 < $time && $time <= 604800){
		return round($time/86400,0).' days';
	}
	if(604800 < $time && $time <= 2592000){
		return round($time/604800,0).' weeks';
	}
	if(2592000 < $time && $time <= 29030400){
		return round($time/2592000,0).' months';
	}
	if($time > 29030400){
		return date('M d y at h:i A',$start);
	}
}