I am using this logic to calculate the number of sections in a given course. But, it seems to be coming out one week short.
$course->numsections = ceil( $endtime - $starttime ) / ( 60 60 24 * 7 );
So, for example if the start date is Jan 18th and the end date is May 14, it should return 17 sections. Instead it is returning 16 sections.
How do I fix it so the calculations works correctly?