Joined February 2015
·

Oscar

Norway
·
·

Posted to Get the previous working day over 1 year ago

Just did this myself. Got it a bit shorter though =)

$lastWorkingDay = date( "d", strtotime("today -1 Weekday") );

Or if you need to include today too, like in my case:

$lastWorkingDay =(date("N")<=5)?date("Y-m-d"):date("Y-m-d",strtotime('today -1 Weekday'));

Achievements
1 Karma
0 Total ProTip Views