klinmy Posted February 9, 2006 Share Posted February 9, 2006 i would like to calculate working days (except for friday and saturday) between 2dates. how should i do? [code]<? $today = $end_date; $pastdate = $start_tarikh; $explodetoday = explode("/", $today); $stoday = mktime(0, 0, 0, $explodetoday[1], $explodetoday[0], $explodetoday[2]); $explodepastdate = explode("/", $pastdate); $spastdate = mktime(0, 0, 0, $explodepastdate[1], $explodepastdate[0], $explodepastdate[2]); $sDifference = $stoday - $spastdate; $total= ($sDifference / 60 / 60 / 24 ); ?>[/code]it works well to count the number of days without considering friday and saturday are offdays. wht should i add on in above code inorder to count only days except for friday and saturday? thx Link to comment https://forums.phpfreaks.com/topic/3360-count-number-of-days/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.