Get span between two dates

This function will return how many days there are between two UNIX timestamps.

function GetSpan ($date1, $date2) {
	// Return how many days there are between two UNIX timestamps
	$days = 60 * 60 * 24;
	return floor(($date2 - $date1) / $days);
}
Leave a comment
Name
Email (optional)
Your email will only be used to show your Gravatar and to send you replies to this article (if you opt to receive them). You won't get ANY other messages at all!
Comment
No HTML allowed
Notify me via email
 
 
Share

Valid HTML 4.01 Strict