Simple Function to calculate no. of days between two dates

by Guna 2011-03-11 16:38:51

Hi,

This function calculates days count between two given dates. check it outSmile

function dateDiff($start, $end) {

$start_ts = strtotime($start);

$end_ts = strtotime($end);

$diff = $end_ts - $start_ts;

return round($diff / 86400);

}
//echo dateDiff("2008-03-29", "2008-03-30") ."
";
//echo dateDiff("2008-03-29", "2008-03-31") . "
";

Tagged in:

1139
like
0
dislike
0
mail
flag

You must LOGIN to add comments