Working days (Mon-Fri) in PHP

fredley picture fredley · Nov 23, 2010 · Viewed 41.6k times · Source

Is there a way to use strtotime to add working days (Monday to Friday) to a date? Or some other method? What I want to do is:

date ( 'Y-m-j' , strtotime ( '+3 working days' ) )

Answer

John Giotta picture John Giotta · Nov 23, 2010

If you are limiting to weekdays use the string weekdays.

echo date ( 'Y-m-j' , strtotime ( '3 weekdays' ) );

This should jump you ahead by 3 weekdays, so if it is Thursday it will add the additional weekend time.

Source: http://www.php.net/manual/en/datetime.formats.relative.php