Calculating for the academic year using php -
i trying calculate current academic year of school. well, school's academic year falls between august , may. assuming in 2013 in month of august, academic year becomes 2013-2014. when in month of may in year 2013 academic year becomes 2012-2013.
i want utilize php derive current academic year, have far. want know if there improve solution or on right path.
$currentyear=date("y"); $currentmonth=date("m"); if($currentmonth >="08") echo ($currentyear).'-'.($currentyear + 1); if($currentmonth < "08") echo ($currentyear-1).'-'.($currentyear);
you can use
date('y').'-'.(date('y')+1); php
No comments:
Post a Comment