How to calculate the weeks between two dates.
//php code
$today=date('Y-m-d h:i:s');
$fromData="2014-01-01 00:00:00"
$diff = strtotime($today, 0) - strtotime($fromData, 0);
$weekNo = floor($diff / 604800);
$weekNo = $weekNo+1;
echo "This is the ".$weekNo." of the Year 2014";
//end
//php code
$today=date('Y-m-d h:i:s');
$fromData="2014-01-01 00:00:00"
$diff = strtotime($today, 0) - strtotime($fromData, 0);
$weekNo = floor($diff / 604800);
$weekNo = $weekNo+1;
echo "This is the ".$weekNo." of the Year 2014";
//end
No comments:
Post a Comment