After viewing the page with dates of the relative PHP.NET format , I am still confused by the order of operations with several relative dates in the strtotimesubtraction.
I noticed that the following is coming back 1/9/2015 .
strtotime('next friday -7 days', strtotime('1/16/2015'))
However, the next return is 1/30/2015 .
strtotime('next friday +7 days', strtotime('1/16/2015'))
I would understand this, since from 1/16/2015 Friday next Friday will be 1/23/2015 (similar to the way the second strtotime works above). Then we subtract or add seven days.
As you can see, this is not like subtraction. A more detailed explanation when streamlining these operations.
source
share