Jump to content

count number of days


klinmy

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.