title: Round datetime to last hour
body: <p>I tried to look for this but I could not find good example of this what im trying to do.</p>
  
  <p>I got datetime values in MySQL database that has to be rounded down when that value is on use.</p>
  
  <p>Example, all these values:</p>
  
  <blockquote>
    <p>2013-04-20 07:14:42<br>
    2013-04-20 07:19:51<br>
    2013-04-20 07:37:26<br>
    2013-04-20 07:46:28<br>
    2013-04-20 07:59:44<br></p>
  </blockquote>
  
  <p>Should be rounded down to:</p>
  
  <blockquote>
    <p>2013-04-20 07:00:00</p>
  </blockquote>
  
  <p>And </p>
  
  <blockquote>
    <p>2013-04-20 16:25:34 </p>
  </blockquote>
  
  <p>should be: </p>
  
  <blockquote>
    <p>2013-04-20 16:00:00 etc...</p>
  </blockquote>
  
  <p>PHP code that gets date value:</p>
  
  <pre><code>$d = strtotime($row["date"]);
  </code></pre>
  
  <p>So, how its possible to round down datetime value? </p>