Home

Sunday, March 18, 2012

How to count day between two dates in php

$startTimeStamp = strtotime("2012/03/01");
$endTimeStamp = strtotime("2012/03/15");

$timeDiff = abs($endTimeStamp - $startTimeStamp);

$numberDays = $timeDiff/86400;  // 86400 seconds in one day
// and you might want to convert to integer
$numberDays = intval($numberDays);

1 comment:

rathoddhirendra.blogspot.com-Google pagerank and Worth