title: Issue with getting week starting from sunday
body: <p>Following is the function which I have created for getting sunday as a starting day of a week,</p>
  
  <pre><code>
  function getCurrentIntervalOfWeek($liveratetime) {
      // get start of each week.
      $dayofweek = date('w', $liveratetime);
      $getdate = date('Y-m-d', $liveratetime);
      $createstart = strtotime('last Sunday', $getdate);
      $weekstart = ($dayofweek == 0) ? $liveratetime : $createstart;
      // get the current time interval for a week, i.e. Sunday 00:00:00 UTC
      $currentInterval = mktime(0,0,0, date('m', $weekstart), date('d', $weekstart), date('Y', $weekstart));
      return $currentInterval;
  }
  </code></pre>
  
  <p>Here liveratetime is the epoch time of any day in a week. Basically this function takes the liveratetime and looks for last sunday so as to get the current interval for that perticulat liveratetime epoch.</p>
  
  <p>but the issue here is that, whenever I try to get current interval from this for certain liveratetime the <pre><code>$createstart = strtotime('last Sunday', $getdate);</code></pre> gives me <pre><code>-345600</code></pre>. And I am not getting why? can anyone please share a light on this.</p>
  
  <p>This usually happens on the past dates like <pre><code>2007-10-02</code></pre></p>