title: PHP: Week starts on Monday, but "monday this week" on a Sunday gets Monday next week
body: <p>Here's a summary of the issue: On Sundays, <code>strtotime('this week')</code> returns the start of next week.</p>
  
  <p>In PHP, the week seems to start on Monday. But, on any day except Sunday, this code</p>
  
  <pre><code>echo date('Y-m-d', strtotime('monday this week', strtotime('last sunday')));
  </code></pre>
  
  <p>Outputs the date of this week's Monday, when it seems like it should be outputting last weeks Monday. It seems like, in this case, PHP is treating both Sunday and Monday as the the start of the week. It's now Monday, Dec 10, 2012, or 2012-12-10. <code>date('Y-m-d', strtotime('sunday last week'))</code> returns <code>2012-12-09</code> - yesterday.</p>
  
  <p>Is this a bug, or am I missing something? It seems like a bug this obvious should be fairly well known, but I can't find anything about it. Is the only way to get the start of the week to use some special handling for Sundays?</p>
  
  <pre><code>$week_offset = (int) 'sunday' == date('l');
  $week_start  = strtotime("-$week_offset monday"); // 1 or 0 Mondays ago
  </code></pre>